Percent-encode text so it is safe to drop into a URL, or decode an ugly encoded link back into something readable.
How to use this tool
- Choose Encode or Decode.
- Choose Component or Whole URL (see below — this is the part people get wrong).
- Paste your text. The result updates as you type.
- Click Copy, or Swap to reverse the operation.
Component vs whole URL
This is the distinction that trips people up, and it maps directly to two different JavaScript functions:
- Component (
encodeURIComponent) also encodes/,?,&,=, and#. Use it for one value — a single query parameter, a path segment, a form field. If you are building?q=<value>, the value needs component encoding, or an&inside it will silently split your query string. - Whole URL (
encodeURI) leaves URL structure characters alone. Use it when you have a complete address with spaces or accents that needs cleaning up, and you wanthttps://and the?separators to keep working.
Encoding a whole URL in component mode is the classic mistake — you end up with https%3A%2F%2F..., which is a broken link.
Tips
- Spaces become
%20. In query strings you will also see+used for spaces; both decode to a space, but%20is safe everywhere. - Decoding fails on a lone
%that is not followed by two hex digits. If you see an error, look for a stray percent sign. - Non-Latin text encodes to several bytes per character, so a short Arabic or Japanese phrase can produce a surprisingly long string. That is normal.
Related tools
- Base64 encoder & decoder — a different encoding for a different job
- Slug generator — build clean URLs instead of encoding messy ones
- HTML entity converter — escaping for HTML rather than URLs
- QR code generator — turn a finished URL into a scannable code
FAQ
Does this send my URL anywhere?
No. It calls the browser's built-in encodeURIComponent/decodeURIComponent functions locally. Nothing leaves your device.
Why did my & break the link?
Because & separates parameters. If a value contains & it must be encoded to %26 using Component mode, otherwise everything after it is read as a new parameter.
What characters actually need encoding?
Anything outside the unreserved set: letters, digits, -, ., _, and ~. Everything else — spaces, punctuation, non-Latin characters — should be percent-encoded to be safe across all servers.
Should I use + or %20 for a space?
Use %20. The + convention only applies inside application/x-www-form-urlencoded query strings, and it is interpreted as a literal plus sign in a path.
Can I encode an entire URL including the domain?
Only if you are passing that URL as a value inside another URL — for example a redirect_uri parameter. In that case use Component mode. To merely tidy up a URL you intend to visit, use Whole URL mode.
More developer tools
Base64 Encoder & DecoderEncode text to Base64 or decode Base64 back to text, right in your browser. Handles emoji and accented characters correctly, with URL-safe output.
HTML Entity Encoder & DecoderEscape HTML so tags display as text, or decode entities back into characters. Supports all HTML5 named entities, in your browser.
Image to Base64Convert images to Base64 data URIs in your browser. No upload. Copy the result for use in HTML or CSS.
JSON FormatterFormat and minify JSON in your browser. Paste JSON, click Format or Minify. No data sent to any server.
