DevLearningTools

TOOLS · URL ENCODING

Encode or decode a URL, safely.

Paste in a URL or query string with special characters and get a properly percent-encoded version — or go the other way, decoding an encoded string back to something readable.

What URL Encoding Is

URLs can only safely contain a limited set of characters. Anything outside that set — spaces, &, =, ?, non-English characters, and more — has to be percent-encoded into a %XX sequence (where XX is the character's hex value) so it doesn't get misread as part of the URL's structure. A space becomes %20, & becomes %26, and so on.

Without encoding, a value like Q&A?fun#times would confuse a URL parser, since &, ?, and # all have special meaning in a URL — encoding lets you pass that exact text through safely as data instead of structure.

How This Tool Works

Encoding and decoding run entirely in your browser using the same percent-encoding logic browsers themselves use. Paste in a URL, query string, or plain text with special characters to get a safely encoded version, or decode an encoded string back into readable text.

Common Uses

  • Safely building a query string parameter that contains spaces, symbols, or non-English text.
  • Decoding a URL copied from a browser address bar or server log to see what it actually contains.
  • Debugging why a URL parameter isn't being read correctly by an API or web form.

Frequently Asked Questions

What's the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes almost every special character, making it right for individual values you're inserting into a URL (like a query parameter). encodeURI encodes less, since it assumes you're passing in a complete URL and leaves characters like /, :, and ? alone because they're structurally meaningful there. This tool behaves like encodeURIComponent, suited for encoding individual pieces of data.

Why do spaces sometimes show up as + instead of %20?

Both are valid depending on context — %20 is the general percent-encoding for a space, while + is a convention specifically used inside application/x-www-form-urlencoded form data (like a query string from an HTML form). This tool uses the %20 form, which is safe and correct everywhere.

Which characters actually need encoding?

Reserved characters with structural meaning in a URL (&, ?, #, =, /, :, and a few others), spaces, and any non-ASCII characters (accented letters, emoji, non-English scripts) all need encoding. Letters, digits, and a small set of characters like -, _, ., and ~ are safe as-is.