Overview
Axum is an HTTP routing and request-handling library for Rust that focuses on ergonomics and modularity. You define routes with a macro-free API, write handlers as async functions, and use extractors such as Json, Path and Query to parse requests into typed values. Responses are built from simple return types with little boilerplate.
What sets it apart is that Axum has no middleware system of its own. It uses tower::Service, so timeouts, tracing, compression, authorisation and other tower-http middleware work out of the box and can be shared with applications written directly on hyper or with the tonic gRPC library.
Axum is a thin layer over hyper, so its performance is comparable to hyper, and the crate forbids unsafe code. It is maintained under the tokio-rs organisation, and the repository dates from May 2021.
Axum is still pre-1.0. Version 0.8 (January 2025) changed path parameter syntax and other APIs, and the main branch is working towards 0.9 with further breaking changes, so upgrades between minor versions can require code changes. The minimum supported Rust version is 1.80.
Pricing and plans
What it does
- Macro-free routing
- Plain function calls define routes and handlers.
- Extractors
- Declaratively parse JSON, path, query, headers and state into typed values.
- Tower middleware
- Reuse tower and tower-http for timeouts, tracing, compression and auth.
- hyper and Tokio
- Thin layer over hyper on the Tokio runtime.
- 100% safe Rust
- The crate uses forbid(unsafe_code).
Strengths and limitations
Strengths
- Backed by the Tokio project, the core of async Rust
- Middleware shared with hyper and tonic services
- Predictable error handling and strong typing
- Low overhead on top of hyper
Limitations
- Pre-1.0: minor versions such as 0.8 include breaking changes, and 0.9 is in progress
- No ORM, templates, auth or project structure built in
- Requires understanding tower services and Rust async to go beyond basics
- Minimum supported Rust version is 1.80
Who it suits
Good for
- High-performance APIs in Rust
- Teams already using Tokio, hyper or tonic
- Services where memory safety and low latency matter
Look elsewhere if
- Teams new to Rust who need to ship quickly
- Projects wanting a batteries-included framework (see Loco)
Pricing history
-
Axum 0.8 released with breaking changes
Announced 1 January 2025. Path parameters changed from /:param and /*rest to /{param} and /{*rest} (old syntax panics), handlers must be Sync, and the Host extractor moved to axum-extra. Source ↗
Alternatives to Axum
| Tool | From | Free option | Stages |
|---|---|---|---|
| Ruby on Rails Full-stack Ruby web framework | — | ||
| FastAPI Python API framework | $20/mo | Free tier | |
| Django Batteries-included Python web framework | — | ||
| Fastify High-performance Node.js web framework | — | ||
| Encore Backend framework with infrastructure from code | $49/mo | Free tier | |
| ASP.NET Core .NET web framework | — |
Questions
Axum or Actix Web?
Axum reuses tower middleware and is maintained by the Tokio project; Actix Web has its own middleware and a richer built-in feature set.
Is Axum stable?
It is widely used but still pre-1.0, and minor versions such as 0.8 include breaking changes.
Does Axum have middleware?
It uses tower and tower-http middleware rather than its own system.
Is Axum free?
Yes, it is MIT licensed.
Sources read for this page