URL / URI Tools

URI template testersee every expanded expression

Enter one template and a JSON object. Inspect the URI and the contribution of each expression.

URI template tester

URI template

Variables JSON

Templates and variables stay in this browser. Addresses are never requested.

Expanded URI

Omitted variables: None

Unused JSON keys: None

Expression details

Line 1, column 24

{/version,resource}
  • Variable: version · Defined
  • Variable: resource · Defined

Expanded part: /v1/search

Line 1, column 43

{?q,page,tags*}
  • Variable: q · Defined
  • Variable: page · Defined
  • Variable: tags* · Defined

Expanded part: ?q=hello%20world&page=2&tags=red&tags=blue

Showing 2 of 2 expressions

Expansion syntax

RFC 6570 Level 4: {var}, {+var}, {#var}, {.var}, {/var}, {;var}, {?var}, {&var}; :n takes a prefix and * explodes a list or map.

Limits in UTF-16 units: template 16,384; JSON 65,536; output 262,144; up to 500 expressions.

2 expressions · 0 omitted variables · 75 output units

A slash inside an identifier can become %2F while the same slash in a base path must survive. The URI template tester lets you inspect this difference with the actual variable values before embedding a template in an API client.

Use this URI template expander for a concrete RFC 6570 experiment: choose a sample, change an operator and compare the generated fragments. The URI template parser accepts relative references too, so a successful expansion does not imply a complete web address.

Why use this URI template tester

Trace a URL back to its expressions

The URI template tester shows where each expression begins and what it contributes. When a query parameter disappears, check whether its variable is missing, null or an empty collection before changing the template. An empty string is shown separately.

Colored values fill matching slots in a template and form path and query segments.

See what the star actually changes

A list in {?tags} becomes one comma-separated value. In {?tags*}, every item gets its own tags parameter. Exploding a map instead uses its member keys. The details keep those output fragments next to the expressions that produced them.

Three colored list items form one grouped value above and three separate query pairs below.

Choose the value shape before the operator

01

Keep variable names literal

Use an object with exact keys. The name user.id refers to the key "user.id", not a nested object. A percent-encoded name also needs that exact spelling in the JSON.

02

Compare the supplied cases

Load the reserved-character example to inspect a path that keeps its slashes. Use the composite example for exploded lists, map keys and Unicode prefixes. Loading first previews the replacement; Undo restores both editors and the previous result.

03

Control when a run becomes current

Automatic expansion waits 350 ms after edits. Turn it off for the button or Ctrl/Cmd + Enter. Editing disables exports immediately; copying becomes available only after the current inputs expand successfully.

Inspect encoding, values and diagnostics

All four template levels

The URI template tester supports simple expansion plus +, #, ., /, ;, ? and &. Prefix modifiers accept 1–9999 Unicode characters; explode handles lists and maps. The selected operator determines percent encoding and separators.

Numbers retain their original spelling

Numeric JSON tokens remain text throughout expansion. An ID such as 9007199254740993 stays exact; -0 and exponent notation also retain their spelling. Booleans expand as true or false. No floating-point conversion silently changes the value.

Failures point to the source

Invalid expressions and JSON syntax errors include a line and column. Duplicate keys are rejected. Unsupported nested values identify their JSON Pointer. Undefined variables are diagnostics, not syntax failures: their expressions may still produce a valid empty substring.

A report that can reproduce the run

Copy gives only the expanded URI. The JSON download includes the template, raw variables JSON, complete expression details and omitted or unused names. The interface shows 50 expressions at a time; the report includes them all.

The boundaries of a template expansion

One object, shallow values
The root JSON value must be an object. Values may be strings, numbers, booleans, null, lists of scalars or maps of scalars. Nested containers are rejected, including unused ones; file import and batches of variable objects are outside this page.
Missing differs from empty
Missing keys, null and empty collections are omitted. Null collection members are skipped. An empty string remains defined: {?x} yields ?x= while {;x} yields ;x. An empty template is allowed when valid variables JSON is supplied.
Names are exact identifiers
Names are case-sensitive. Dots do not traverse JSON, and percent triplets inside names are neither decoded nor normalized. Duplicate JSON names are errors instead of a last-value-wins rule. Map member order follows the source JSON.
Encoding is not URL normalization
Ordinary expansion encodes a percent sign again; + and # preserve valid percent triplets and reserved characters. Literal spaces are invalid. Unicode is encoded as UTF-8 without normalization; no protocol, base URL or host conversion is added.
Finite inputs and complete results
Template, variables and output limits are 16,384, 65,536 and 262,144 UTF-16 units, with 500 expressions maximum. The shared JSON parser also caps depth at 100, nodes at 50,000 and number tokens at 1,000 characters. Errors disable export of any partial or previous result.
Expansion has one direction
There is no reverse route matching, remote import, endpoint check, default-value syntax or expression execution. Operator separators are fixed by RFC 6570. To customize a value, prepare it in the JSON rather than embedding a script in braces.

URI template tester questions

Percent-encoding in uri templates

Keep the expression braces literal: /users/{id} contains a variable. /users/%7Bid%7D contains encoded literal braces and is not expanded. Supply the value without encoding the whole template first; the expression operator performs the appropriate encoding.

RFC 6570 URL Templates: the role of / vs. other prefixes

The / operator adds a slash before each defined variable; exploding a list adds one slash per item. Simple expansion encodes slashes inside values. Reserved expansion with + preserves them but adds no slash itself. These are different rules, not interchangeable formatting choices.

Can RFC 6570 URI Templates encode space separators for optional parameters?

There is no operator for an arbitrary optional space separator. Prepare a single string containing the desired words and expand that value; its spaces become %20. Exploding a list uses the separator defined by its operator, such as / or &, not a configurable delimiter.

RegEx for URI Templates (RFC 6570) wanted

A regular expression alone cannot check the variable values. Even a syntactically valid {items:3} is invalid when items is a list. This tool parses expressions and checks the supplied JSON as part of expansion, reporting a source location when the run fails.

Can URI templates be used to match URIs to routes?

RFC 6570 specifies expansion from variables to a URI. Recovering variables can be ambiguous, especially for multiple variables, reserved expansion and exploded maps. This page does not reverse a URI into route parameters; use a route-matching tool for that task.

Something looks wrong?

Try your URI template tester case

Compare a reserved path or exploded query with your actual variable object, then save the current report.

One template, one variable object, inspectable results.