Code Beautify / MULTIVERTO

Escape JSON Pointer token

Escape a property name for use as one JSON Pointer token.

Live converterYour input stays in this browser. No text is uploaded for conversion.

The file stays in your browser.
Chain tools

Apply each text tool to the previous result. Text workflows ↗

Only the recipe name and tool order are saved in this browser. Your input and results are never saved.

01 / Example

Example

Your inputname/a~b
Resultname~1a~0b

02 / Guide

Escape JSON Pointer token — How it works

What the conversion does

Escape a property name for use as one JSON Pointer token. Replace a tilde with ~0 and a slash with ~1 in that order.

Worked example

The sample input is name/a~b; its converted form is name~1a~0b.

Format rules and limits

A JSON Pointer is a sequence of reference tokens separated by literal slashes. This page transforms one token, not an entire pointer and not a URL fragment. RFC 6901 reserves two characters inside tokens: tilde is written ~0 and slash is written ~1. On decoding, ~1 must be handled before ~0, so ~01 becomes ~1 rather than a slash. Prepare one property name for insertion into an RFC 6901 pointer rather than encoding an entire JSON document. Treat the field contents as one raw name. For a property literally named a/b, the token is a~1b; a~b becomes a~0b. If both characters occur, escaping the tilde first prevents the newly introduced tilde in ~1 from being processed again. The result contains no path separator added by the tool. To address a nested property, encode each name independently and join the tokens yourself. A plain slash pasted as input means a slash inside the name, not a request to start a path.

Check the result

To verify a pointer token, encode a property name and decode the output; the recovered text should match exactly, including any literal tilde or slash. When assembling a complete JSON Pointer, put slashes between already escaped tokens. A leading slash belongs to the pointer path and is not part of a token supplied to this tool. Test the special input ~1 separately because decoding order matters. Enter a name containing both slash and tilde, then unescape its output. The recovered name must match exactly; add the leading path slash only after escaping the token. Use the result as one token within a larger pointer. The converter does not prepend the slash separating levels, and an input slash is part of a property name rather than a navigation request. Test a name containing both slash and tilde to see why the replacement order matters. Once tokens are joined, a consuming parser must split the complete pointer on literal separators before reversing token escapes. Keep the raw property name to compare with the decoded token; a mismatch can address a different member without producing a syntax error.

How this conversion transforms the input
Text — Input
Read and transform structure
Pointer token — Result

Explore guides

Conversion guides

Explore guides