calculate.sh DE

This tool runs in your browser using JavaScript. If it does not appear, please enable JavaScript or reload the page. The description below explains how it works.

URL Encoder

A URL can only contain a limited set of characters. Spaces, accented letters, emojis, or characters like & and # have a special meaning inside a URL - a space would break the path, a & would start a new query parameter. Percent-encoding solves this by rewriting every unsafe character as a % followed by two hexadecimal digits: a space becomes %20, and ü becomes %C3%BC. This tool performs that transformation in both directions, for single components as well as complete URLs.

How to use

  1. Choose a direction - Encode turns plain text into its percent-encoded form; Decode turns a percent-encoded string back into readable text. The result updates as you type.
  2. Pick a scope - Component or Full URL (see below). This decides which characters the encoder leaves untouched.
  3. Swap - moves the current result into the input and flips the direction, so you can chain encode → decode → encode and inspect intermediate results.
  4. Copy - copies the output. In Decode + Component mode, an extra Treat + as space checkbox appears for form-style query strings.

Component vs Full URL

  • Component uses encodeURIComponent/decodeURIComponent. It encodes the maximum set: even characters that are structural in a URL, such as /, ?, :, &, and #, are turned into %2F, %3F, %3A, %26, and %23. Use this when you embed one value into a URL - a single search term, a parameter value, a filename - where every reserved character must lose its meaning.
  • Full URL uses encodeURI/decodeURI. It protects the URL's skeleton (scheme://host/path?query#fragment) and only encodes the characters that actually need escaping inside that structure. Use this when you start from a readable URL with a few stray spaces or accents and want a valid link back: https://example.com/a b?q=it's great becomes https://example.com/a%20b?q=it's%20great.

The round trip components ↔ full is only meaningful on the characters that differ; everything else decodes back to exactly the text you started with.

Notes and examples

  • Hello Wörld! in component mode is Hello%20W%C3%B6rld!.
  • An emoji such as 😀 becomes %F0%9F%98%80 - four percent sequences for four UTF-8 bytes. Percent-encoding always works on the UTF-8 bytes of the input, never on ISO-8859-1, so the tool's output is what a modern web server expects.
  • An apostrophe is not encoded by encodeURIComponent (it is a legal character), so it's stays it's. If you need apostrophes encoded for legacy middleware, this tool follows the Web standard and leaves them as-is.
  • Treat + as space matters because HTML forms historically used + to mean a space in their query encoding. Decoding a+b+c with the box ticked yields a b c; unticked it yields a+b+c. This option only appears (and only applies) in Component mode.
  • Malformed input gives a specific error. Decoding a string with a stray % or %zz raises a clear message about invalid percent-encoding instead of forcing broken output through.

When to use this over the Base64 tool

Both tools encode text, but for different destinations. Base64 produces compact ASCII that is opaque - it is for data storage and JWT-style payloads, and it changes the size of the data. URL encoding is transparent (you can often read the original text inside), guarantees a string that is safe inside a URL, and is the form to use for query parameters, anchor fragments, and file names. If the encoded output is going into a URL, use this tool.