Next.js middleware matcher builder. Build and test middleware config matcher patterns visually with live URL testing and regex preview.
100% browser-based — your data never leaves your device
Build and test Next.js middleware config matcher patterns visually.
export const config = {
matcher: [],
}Visual builder for Next.js App Router routes including groups and parallel routes.
Middleware Matcher BuilderBuild and test Next.js middleware config matcher patterns visually.
next.config VisualizerParse and explore next.config.js/ts options with descriptions and defaults.
Image Optimization CalculatorCalculate optimal image dimensions, sizes, and srcset for Next.js Image.
Route Handler GeneratorGenerate Next.js App Router API route boilerplate with type safety.
Middleware matchers are compact regex-like patterns that decide which paths run your middleware, and one wrong character can silently break authentication across your app. This builder lets you assemble and test those patterns before they touch production.
Matcher configuration is where middleware projects go wrong, typically because patterns that look right on paper behave unexpectedly with real URLs. The use cases are building and testing matcher patterns for authentication middleware, excluding static assets and API routes from middleware processing, and debugging complex matcher configurations with live URL testing. Developers wiring up auth, rate limiting, or geolocation all benefit from testing before shipping.
The builder removes the guesswork. The pattern builder composes paths with visual toggles, live testing answers whether a specific URL matches or is excluded, and the regex preview shows the compiled expression your patterns produce. The config export produces a complete matcher object you can drop directly into your project.
Middleware matchers reveal the protected and public areas of your application, including admin paths, API boundaries, and the exact routes your access control guards. Uploading that configuration to an online builder hands a third party a map of your application's security perimeter.
This builder works entirely in your browser, so your patterns and test URLs never leave your device. You can design and verify access-control logic privately without exposing your application's protected structure.
Enter URL paths like /dashboard/* or /api/:path* to define which routes should trigger your middleware.
Use the live testing panel to enter test URLs and see instantly whether they match or are excluded by your matcher configuration.
Check the compiled regular expression to verify your patterns behave as expected before deploying.
Copy the complete matcher configuration object ready to paste into your middleware.ts or next.config file.
Practical examples to help you get the most out of Middleware Matcher Builder:
matcher: ['/((?!api|_next/static|favicon.ico).*)'] This pattern matches all routes EXCEPT API routes, Next.js static files, and the favicon.
matcher: ['/dashboard/:path*', '/profile/:path*', '/settings'] Only these specific routes will trigger the middleware.
Always start matcher paths with a forward slash (/dashboard), not 'dashboard'. Without the leading slash, the pattern won't match any URL.
Always exclude _next/static and favicon.ico in your matcher pattern. Running middleware on static assets wastes server resources and can break asset loading.
The matcher config in next.config.js tells Next.js which paths should trigger your middleware. It uses pattern matching to include or exclude specific routes.
Use negative lookahead patterns or list specific paths to match. The builder lets you visually add and remove paths from the matcher configuration.
Yes. The live testing feature lets you enter any URL and see instantly whether it matches or is excluded by your matcher pattern.
No. All pattern building and testing happens locally in your browser.
Build matcher patterns with visual toggles for paths, params, and conditions.
Test URLs against your matcher patterns and see match/no-match results.
See the compiled regex from your matcher patterns.
Export the complete matcher configuration ready for middleware.ts.
Middleware Matcher Builder is useful in a variety of scenarios across different workflows:
Build and test matcher patterns for authentication middleware
Exclude static assets and API routes from middleware processing
Debug complex matcher configurations with live URL testing
Use patterns like `/((?!api|_next/static|favicon.ico).*)` to exclude common paths from middleware execution.
List more specific paths first in your matcher array so they match faster, improving middleware performance.
Explore more tools in the Next.js workspace:
App Router Path Builder
Visual builder for Next.js App Router routes including groups and parallel routes.
next.config Visualizer
Parse and explore next.config.js/ts options with descriptions and defaults.
Image Optimization Calculator
Calculate optimal image dimensions, sizes, and srcset for Next.js Image.
Route Handler Generator
Generate Next.js App Router API route boilerplate with type safety.