URI Template Expander (RFC 6570)
RFC 6570 URI templates describe how to build a URL from variables, and they're everywhere: the GitHub API, OpenAPI/Swagger path templates, and hypermedia (HAL/JSON-LD) links all use them. A template like `https://api.example.com{/version}/users{/id}{?fields*,page}` expands against a set of variables into a real URL. This tool implements all four levels of the spec — simple `{var}` expansion, the reserved (`{+var}`) and fragment (`{#var}`) operators, label (`.`), path (`/`), path-style parameter (`;`), form-query (`?`), and continuation (`&`) operators — plus the explode (`*`) and prefix (`:n`) modifiers and correct handling of empty and undefined values. Provide variables as a JSON object whose values are strings, numbers, lists, or key/value maps; the output is percent-encoded exactly as the operator requires. It's verified against the full RFC 6570 example suite. Everything runs locally — nothing is uploaded.
Expanded URL
https://api.example.com/v2/users/42?fields=name&fields=email&page=1
Implements all four RFC 6570 levels: operators + : # . / ; ? & with explode (*) and prefix (:n) modifiers.
How to use
- Enter a URI template using {braces}, e.g. {/path}{?query*}.
- Provide the variables as a JSON object (strings, numbers, arrays, or objects).
- Read the expanded URL and copy it; tweak the template or variables to see the result update live.
Frequently asked questions
- What do the operators mean?
- The first character inside the braces selects an operator: none = simple comma-joined values; `+` keeps reserved characters unescaped; `#` makes a fragment; `.` a label; `/` path segments; `;` path-style `;name=value` params; `?` a form query `?name=value`; `&` a query continuation. Each controls its own separator and whether names are included.
- What do `*` and `:n` do?
- `*` is the explode modifier: a list or map expands into separate components (e.g. `{?list*}` → `?list=a&list=b` instead of `?list=a,b`). `:n` is a prefix modifier that truncates a string value to the first n characters before encoding (e.g. `{var:3}` of `value` → `val`).
- How do I pass lists and maps?
- Use JSON: a list is an array (`"fields": ["name","email"]`) and an associative map is an object (`"keys": {"semi": ";"}`). Strings and numbers are scalars. A variable that's missing, null, an empty list, or an empty object is treated as undefined and contributes nothing to the output.
- Is the encoding correct?
- Yes — values are percent-encoded per the operator's allowed set. Simple and most operators encode everything outside the unreserved set, while `+` and `#` also pass reserved URL characters (and existing %XX triples) through unescaped, matching RFC 6570. The implementation passes the spec's full example table.
Related tools
IPv6 Expander / Compressor
Toggle any IPv6 address between its shorthand ::1 form and the fully-expanded 8-group representation, with reverse DNS and binary too.
/.well-known/* URI Reference
Searchable catalog of well-known URIs registered with IANA — `security.txt`, `openid-configuration`, `apple-app-site-association`, `acme-challenge`, and 30+ more, with RFC references and use cases.
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
Data URI Parser & Decoder
Decode a data: URI to see its MIME type, encoding, size and decoded contents, in your browser.
OAuth 2.0 PKCE Generator
Generate code_verifier + S256/plain code_challenge for OAuth 2.0 PKCE (RFC 7636). Also builds the authorization URL and a ready-to-paste curl for the token exchange.
mailto: Link Builder
Build a mailto: URL with To, Cc, Bcc, subject, and body — RFC 6068 percent-encoded, ready to drop into an <a> tag.