Stage 03 · Host · Researched comparison
Best Go HTTP Routers in 2026
chi is the first pick for most teams that want a small, idiomatic router built on net/http handlers, with middleware support and route groups. If you want zero dependencies, the Go 1.22 net/http ServeMux pattern matching covers method and wildcard routing. gorilla/mux remains a reasonable choice for projects that already depend on it or need its matcher API.
By Shihab Mia
Published 27 Nov 2026 · 7 tools compared
We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
- chi, gorilla/mux, httprouter and bunrouter are all free and open source, so cost is not the deciding factor.
- Go 1.22 added method and wildcard patterns to net/http ServeMux, which removes the need for a third-party router in many small services.
- Routers differ mainly in handler signature, middleware model and path matching rules, so pick one that matches your existing handlers.
- Gin and Echo bundle their own routers inside larger frameworks; choose them only if you want the full framework.
Who each pick is for
- Teams wanting a small router that stays close to net/httpchi
- Services that want routing with no third-party dependencyGo 1.22 net/http ServeMux
- Projects needing a rich matcher API and long-standing ecosystem supportgorilla/mux
- High-throughput APIs with simple parameter routingjulienschmidt/httprouter
- APIs that want fast matching with net/http compatibilitybunrouter
- Teams that want a full web framework with its own routerGin router
- Teams wanting a framework with a router, middleware and bindingEcho router
Comparison
| Tool | Best for | Standout feature | Listed starting price | Free plan or trial |
|---|---|---|---|---|
| 1chi | Teams wanting a small router that stays close to net/http | Uses standard http.Handler signatures | Free (open source) | Free plan |
| 2Go 1.22 net/http ServeMux | Services that want routing with no third-party dependency | Part of the standard library | Free (open source) | Free plan |
| 3gorilla/mux | Projects needing a rich matcher API and long-standing ecosystem support | Flexible route matchers for hosts, headers, methods and queries | Free (open source) | Free plan |
| 4julienschmidt/httprouter | High-throughput APIs with simple parameter routing | Small and focused | Free (open source) | Free plan |
| 5bunrouter | APIs that want fast matching with net/http compatibility | Compatible with net/http handlers | Free (open source) | Free plan |
| 6Gin router | Teams that want a full web framework with its own router | Fast routing bundled with binding, validation and rendering | Free (open source) | Free plan |
| 7Echo router | Teams wanting a framework with a router, middleware and binding | Centralized routing with groups and middleware | Free (open source) | Free plan |
How we picked
We compared routers on fit for the job, compatibility with net/http handlers, supported platforms (all are Go libraries, so they run wherever Go runs), licence and price, and the main limits of each project. We also looked at how each router handles path matching, middleware and route groups. Sources are vendor pages, official documentation and project repositories. Prices and maintenance status can change, so confirm details on the project site before you commit.
The tools, one by one
chi
Best for teams wanting a small router that stays close to net/http

What it is and where it fits
chi is a lightweight, idiomatic router built directly on net/http. Handlers use the standard http.Handler and http.HandlerFunc types, so existing middleware and libraries work without adapters. It supports route groups, sub-routers, URL parameters and a middleware stack, and the project maintains a set of small, composable middleware packages.
It runs anywhere Go runs, with no platform constraints. The licence is MIT, and the project is hosted on GitHub with active maintenance. Because it does not include binding, validation or rendering, you add those yourself or pair it with other libraries. Teams that want a single framework with batteries included should look at Gin or Echo instead. Teams that want to keep handlers portable across projects usually find chi a good fit.
Standout: Uses standard http.Handler signatures
Free (open source), as listed by the vendor (chi website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Uses standard http.Handler signatures
- middleware, route groups and sub-routers
- large ecosystem of compatible middleware
Drawbacks
- No built-in request binding or validation
- pattern syntax differs from Go 1.22 ServeMux
Skip it if this limit matters to you: no built-in request binding or validation.
Verdict. A sensible pick for teams wanting a small router that stays close to net/http.
Alternatives in this guide: Go 1.22 net/http ServeMux, gorilla/mux, julienschmidt/httprouter
Go 1.22 net/http ServeMux
Best for services that want routing with no third-party dependency

What it is and where it fits
Since Go 1.22, the standard library ServeMux supports method-qualified patterns such as "GET /items/{id}" and wildcards. That covers a large share of routing needs without adding a dependency. It ships with the Go toolchain, so there is nothing to install and no version to track separately.
The trade-offs are fewer conveniences. There is no built-in route group type or middleware chain helper, though wrapping handlers is straightforward. Pattern precedence follows documented rules, and overlapping patterns can behave in ways that surprise newcomers, so read the net/http documentation on pattern matching. For small services, internal tools and APIs with simple path structures, the standard library is often enough. Teams with complex middleware needs or many route groups may still prefer chi.
Standout: Part of the standard library
Free (open source), as listed by the vendor (Go 1.22 net/http ServeMux website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Part of the standard library
- method and wildcard patterns
- no extra dependency to audit
Drawbacks
- Fewer helpers for groups and middleware
- pattern rules need care with precedence
Skip it if this limit matters to you: fewer helpers for groups and middleware.
Verdict. A sensible pick for services that want routing with no third-party dependency.
Alternatives in this guide: chi, gorilla/mux, julienschmidt/httprouter
gorilla/mux
Best for projects needing a rich matcher API and long-standing ecosystem support

What it is and where it fits
gorilla/mux is a long-standing HTTP router for Go. It offers a request matcher API that can route on path, host, scheme, headers, query values and methods, plus support for sub-routers and middleware. The project was archived and later revived, and it is maintained again as of 2023.
It uses its own route registration style, and handlers are standard http.Handler, so integration with net/http middleware is possible. The main friction is that some patterns, such as named routes and URL building, are specific to this library. New projects that do not need the matcher API may find chi or the standard library simpler. Projects already using gorilla/mux have little reason to migrate unless they want to drop the dependency.
Standout: Flexible route matchers for hosts, headers, methods and queries
Free (open source), as listed by the vendor (gorilla/mux website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Flexible route matchers for hosts, headers, methods and queries
- mature and widely used
Drawbacks
- Handler signature differs from plain net/http
- development pace is slower than newer routers
Skip it if this limit matters to you: handler signature differs from plain net/http.
Verdict. A sensible pick for projects needing a rich matcher API and long-standing ecosystem support.
Alternatives in this guide: chi, Go 1.22 net/http ServeMux, julienschmidt/httprouter
julienschmidt/httprouter
Best for high-throughput APIs with simple parameter routing

What it is and where it fits
httprouter is a minimal, high-performance router known for its radix tree matching. It supports named parameters and catch-all routes, and it has a small API surface. Handlers take a third parameter for params, which differs from plain net/http handlers, though an adapter is available.
The library is deliberately narrow. It does not provide middleware chaining, route groups or request binding. It also has documented restrictions, such as not allowing overlapping routes that could conflict. That strictness can be helpful because it forces explicit route design, but it can also block patterns that other routers accept. It suits developers who want a small dependency and are comfortable with its handler signature. Teams that want standard handlers should choose chi or the standard library.
Standout: Small and focused
Free (open source), as listed by the vendor (julienschmidt/httprouter website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Small and focused
- explicit named parameters and fast dispatch
Drawbacks
- Non-standard handler signature
- no built-in middleware chain
Skip it if this limit matters to you: non-standard handler signature.
Verdict. A sensible pick for high-throughput APIs with simple parameter routing.
Alternatives in this guide: chi, Go 1.22 net/http ServeMux, gorilla/mux
bunrouter
Best for aPIs that want fast matching with net/http compatibility

What it is and where it fits
bunrouter is a lightweight HTTP router from the uptrace project. It uses net/http-compatible handlers and supports route groups, middleware and named parameters. It is designed to be fast and to stay close to the standard library, so handlers remain portable.
The project is smaller than chi, which means fewer tutorials and community answers when something goes wrong. It is maintained as part of the uptrace ecosystem, and the source is on GitHub under an open-source licence. It suits developers who want an alternative to chi with a similar philosophy. Teams that need extensive third-party middleware or a large hiring pool of familiar developers may prefer chi or gorilla/mux.
Standout: Compatible with net/http handlers
Free (open source), as listed by the vendor (bunrouter website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Compatible with net/http handlers
- supports route groups and middleware
- small API
Drawbacks
- Smaller user base
- fewer examples than established routers
Skip it if this limit matters to you: smaller user base.
Verdict. A sensible pick for APIs that want fast matching with net/http compatibility.
Alternatives in this guide: chi, Go 1.22 net/http ServeMux, gorilla/mux
Gin router
Best for teams that want a full web framework with its own router

What it is and where it fits
Gin is a web framework, and its router is one part of it. Routing uses its own context type, which carries parameters, middleware state and helpers for JSON binding and rendering. That makes Gin productive for building APIs quickly, but it also means handlers are tied to the framework and do not plug directly into plain net/http middleware.
Gin is free and open source under the MIT licence. It runs wherever Go runs. The router supports route groups, parameters and middleware. If you only need routing, Gin brings more surface area than necessary. If you want routing plus request binding, validation and response helpers in one package, Gin is a common choice. Compare it against Echo before committing, since both cover similar ground.
Standout: Fast routing bundled with binding, validation and rendering
Free (open source), as listed by the vendor (Gin router website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Fast routing bundled with binding, validation and rendering
- large ecosystem
Drawbacks
- Handlers use gin.Context, not net/http
- framework lock-in
Skip it if this limit matters to you: handlers use gin.Context, not net/http.
Verdict. A sensible pick for teams that want a full web framework with its own router.
Alternatives in this guide: chi, Go 1.22 net/http ServeMux, gorilla/mux
Echo router
Best for teams wanting a framework with a router, middleware and binding

What it is and where it fits
Echo is a Go web framework with its own router, middleware stack, request binding and response rendering. Routes are registered on an Echo instance, and handlers receive an echo.Context that carries parameters and helpers. It supports route groups, path parameters and custom middleware.
Echo is free and open source under the MIT licence. Like Gin, it is a framework rather than a drop-in router, so adopting it means adopting its handler model. That is fine for new services but adds migration work for existing net/http code. Teams that want a standalone router should choose chi, gorilla/mux or the standard library. Teams that want a framework with routing included should compare Echo and Gin on binding, middleware and documentation.
Standout: Centralized routing with groups and middleware
Free (open source), as listed by the vendor (Echo router website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Centralized routing with groups and middleware
- built-in binding and rendering
Drawbacks
- Handlers use echo.Context
- framework-specific patterns
Skip it if this limit matters to you: handlers use echo.Context.
Verdict. A sensible pick for teams wanting a framework with a router, middleware and binding.
Alternatives in this guide: chi, Go 1.22 net/http ServeMux, gorilla/mux
Who should use what
If you are starting a small service and want no dependencies, use the Go 1.22 net/http ServeMux. If you want a small router with standard handlers, middleware and route groups, use chi. If your codebase already uses gorilla/mux and you rely on its matcher API, keep it. If you are building a new API and want binding and rendering included, compare Gin and Echo as full frameworks.
Questions to settle before you buy
What to check before you buy
- Confirm the router's handler signature matches your existing middleware and handlers.
- Check how the router matches paths, especially trailing slashes, wildcards and overlapping routes.
- Verify the project is actively maintained and the licence fits your organization.
- Read the documentation for route groups and middleware chaining if you need them.
- Test your most complex route patterns against the router before migrating a large service.
FAQ
Is chi faster than gorilla/mux?
Both are fast enough for most services, and neither project publishes benchmarks we can cite here. Routing speed is rarely the bottleneck compared with database and network calls. Choose based on handler compatibility, middleware needs and maintenance activity rather than raw speed claims.
Can I use the standard library instead of a third-party router?
Yes. Since Go 1.22, net/http ServeMux supports method-qualified patterns and wildcards. That covers many APIs without extra dependencies. You lose conveniences such as built-in route groups and middleware chains, but you can wrap handlers yourself. For small services, the standard library is often the simplest choice.
Does gorilla/mux still receive updates?
gorilla/mux was archived and later revived. It is maintained again as of 2023. Check the repository for recent commits and releases before adopting it for a new project. Projects already using it can continue, but new projects may prefer chi or the standard library.
Should I use Gin or Echo just for routing?
Probably not. Gin and Echo are full frameworks, and their routers use framework-specific context types. If you only need routing, a standalone router such as chi keeps handlers portable. Choose Gin or Echo when you also want binding, validation and response rendering in one package.
Do these routers work outside Linux?
Yes. All the routers listed are Go libraries, so they run on any platform the Go toolchain supports, including macOS, Windows and Linux. Platform choice does not affect routing behavior.
Sources we checked
Method: how we score · editorial policy.
Change log. First published 27 Nov 2026.