100% Client-Side WASMZero Remote NetworkVerified Spec

URL Encoder

Interactive Studio

Encode or decode URLs and query strings using percent-encoding. Instant feedback with zero server storage.

Loading tool…

About URL Encoder

URLs can only safely contain a limited set of characters — letters, digits, and a handful of symbols like - . _ ~. Everything else, including spaces, ampersands, and non-ASCII characters, has to be represented using percent-encoding: each byte outside the safe set is written as a percent sign followed by its two-digit hexadecimal value, so a space becomes %20 and "café" becomes "caf%C3%A9" once encoded as UTF-8 bytes. This tool uses encodeURIComponent and decodeURIComponent to perform that conversion in either direction.

Encoding matters most for values that get inserted into a URL's query string or path segment, since certain characters have structural meaning in a URL — & separates query parameters, = assigns a value to a key, and / separates path segments. If a value you're inserting contains one of those characters unencoded, it can be misparsed as part of the URL's structure rather than as literal data. That's why a search query like "cats & dogs" needs the ampersand escaped before it's safely embedded as a single parameter value: without encoding, it would look like two separate parameters.

This gets used for building query strings by hand, decoding a URL copied from a browser to read its actual parameter values, or debugging why a link with special characters isn't routing correctly.

How to use URL Encoder

  1. Choose Encode or Decode.
  2. Paste the text or encoded URL fragment.
  3. Copy the result.

Worked examples

Input: café au lait&x=1

Result: caf%C3%A9%20au%20lait%26x%3D1

Input: a b

Result: a%20b

Background

URLs may safely contain letters, digits and a few symbols. Everything else is percent-encoded: each byte is written as % followed by two hex digits. Non-ASCII characters are first converted to UTF-8, so é becomes %C3%A9.

Encode individual query values, not a whole URL. Encoding the full address would also encode the :, / and ? that give it structure.

Common mistakes

  • Encoding an entire URL instead of just the parameter values.
  • Double-encoding, which turns %20 into %2520.
  • Treating + and %20 as always identical. + means a space only in form-encoded query strings.

Frequently Asked Questions

Why does a space become %20 instead of staying as a space?
Raw spaces aren't valid in a URL under the standard percent-encoding scheme used here — they have to be represented as their percent-encoded byte value, %20, so the URL remains a single unbroken token.
Why would I need to encode an ampersand or equals sign?
Those characters have structural meaning in a query string — & separates parameters and = assigns a value — so if a value you're inserting contains one of them, it needs to be encoded first or it will be misread as part of the URL's structure instead of literal data.
Why did decoding show an error?
decodeURIComponent expects percent sequences to be valid escaped UTF-8 bytes. A malformed or incomplete percent sequence — like a stray % not followed by two valid hex digits — causes a decoding error rather than silently guessing what was meant.
Is this the same as encoding an entire URL?
This encodes a component (a single value meant to go inside a URL, like a query parameter), not a full URL — it also escapes characters like / and : that are meant to stay unencoded in a complete URL's structure, so don't run an entire URL through it expecting it to stay a working link.

Fast, local-first developer micro-tools with zero tracking or latency.

Browse All Tools
Local-First Architecture: Toolium parses payloads exclusively in browser memory. Zero network telemetry.
⌘C Copy⌘K Palette