AZ Tools

URI Template Expander (RFC 6570)

Network

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

  1. Enter a URI template using {braces}, e.g. {/path}{?query*}.
  2. Provide the variables as a JSON object (strings, numbers, arrays, or objects).
  3. 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