JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Percent-encode text for safe use in a URL — spaces, ampersands, slashes and any other special characters become %-codes. Uses encodeURIComponent, in your browser.
Your browser is preparing the tool. It runs 100% locally.
Paste text and the tool percent-encodes it with the browser's encodeURIComponent, turning spaces, slashes, ampersands, question marks and other special characters into their %-codes so they travel safely inside a URL. It encodes a single piece — a query value — not a whole URL, so the slashes and colons of a full address get encoded too. Non-English letters become their UTF-8 %-bytes. It runs entirely in your browser.
Type or paste a value and you get its percent-encoded form, ready to drop into a query string or path segment. A space becomes %20, a slash becomes %2F, an ampersand becomes %26 — anything with a special meaning in a URL is replaced by a percent sign and its hex code, so the value cannot break the link it sits in.
It encodes a component, not a complete URL. Because it escapes the reserved characters that separate the parts of a URL (the slashes, colon, question mark and ampersand), running a whole address through it encodes those separators too — which is exactly what you want for a single value, but not for a finished URL.
The tool runs your text through JavaScript's encodeURIComponent. That leaves the unreserved characters untouched — the letters A to Z, the digits, and a few symbols (hyphen, underscore, dot, tilde, and also the exclamation mark, apostrophe, parentheses and star) — and percent-encodes everything else, including the reserved characters that have structural meaning in a URL.
Characters outside ASCII are first converted to their UTF-8 bytes, and each byte is encoded separately. So an accented é becomes %C3%A9 (two bytes), and an emoji becomes four %-codes. Decoding reverses the process and reassembles the original character.
space → %20
slash → %2F
question mark → %3F
equals → %3D
ampersand → %26
accented é → %C3%A9 (UTF-8 bytes)a/b?c=d → a%2Fb%3Fc%3DdLetters, digits and the symbols hyphen, underscore, dot, tilde, exclamation mark, apostrophe, parentheses and star are left as-is; everything else is percent-encoded. This encodes a single value, not a whole URL.
Your text is encoded in your browser with a built-in JavaScript function. Nothing is sent to a server, so you can safely encode values that contain private data.
Remember that percent-encoding is not encryption — it is fully reversible by anyone. Encode for safe transport, not for secrecy.
| Method | encodeURIComponent (browser built-in) |
|---|---|
| Encodes | reserved characters, spaces, non-ASCII |
| Leaves alone | letters, digits, hyphen, underscore, dot, tilde, and ! ' ( ) * |
| Space becomes | %20 (not a plus sign) |
| Non-ASCII | UTF-8 bytes, each percent-encoded |
| Scope | one value or component, not a whole URL |
| Where it runs | In your browser — nothing uploaded |
It encodes a single component, not a whole URL. Run a complete address like the home page of a site through it and the slashes and colon become %2F and %3A, breaking the URL. Encode individual values (a search term, a parameter) and assemble the URL around them.
A space becomes %20, not a plus sign. Some systems (HTML form submissions) use a plus for a space in the query string; if you need that form, replace %20 with a plus yourself after encoding.
encodeURIComponent does not encode a few sub-delimiters — the exclamation mark, apostrophe, parentheses and star are left as-is even though RFC 3986 lists them as reserved. For most uses this is fine; if a strict parser needs them encoded, handle those characters separately.
It is reversible and offers no security. Percent-encoding hides nothing — anyone can decode it. Never use it to protect passwords, tokens or other secrets.
Encoding the same text twice double-encodes it: a percent sign from the first pass becomes %25 on the second. Encode once, and decode the matching number of times.
Encode a search term or value before adding it to a URL.
Safely place user input into a path segment or query string.
Encode a redirect or campaign value carried inside another URL.
See exactly how a value will look once encoded in a request.
Encoding a complete, well-formed URL? encodeURI (a whole-URL encoder) leaves the separators intact. Need the plus-for-space form? Swap %20 for a plus after encoding. Want the reverse? Use the URL decoder.
Uses the browser's encodeURIComponent, leaving the unreserved characters and a few sub-delimiters (the exclamation mark, apostrophe, parentheses and star) untouched and percent-encoding the rest; it is explicit that this encodes a single value (not a whole URL), that a space becomes %20 (not a plus), and that encoding is reversible, not encryption.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.