URL encoding explained — what %20 means and how to fix broken links

By ToolBite TeamLast updated:

Have you ever seen %20 in a URL and wondered what it means? Or pasted a URL into an email only to have it break? This guide explains URL encoding (also called percent-encoding) and how to handle it correctly.

Best for: developers building APIs, anyone debugging broken URLs, and content managers who need to embed links with special characters.

What is URL encoding?

URLs can only contain a limited set of ASCII characters. Characters outside that set — spaces, accented letters, symbols like &, =, # — must be encoded before being placed in a URL.

URL encoding replaces unsafe characters with a % followed by the character's two-digit hexadecimal ASCII code. A space (ASCII 32 = 0x20) becomes %20. An ampersand becomes %26.

Common encoded characters

encodeURI vs encodeURIComponent (for developers)

JavaScript provides two built-in functions for URL encoding:

Example: to build https://example.com/search?q=hello world&lang=en correctly:

const q = encodeURIComponent('hello world'); // → 'hello%20world'
const url = `https://example.com/search?q=${q}&lang=en`;

Why URLs break — common mistakes

How to encode and decode URLs in your browser

  1. Open ToolBite's URL encoder & decoder.
  2. Paste your URL or text into the input.
  3. Click Encode to percent-encode special characters, or Decode to convert %xx sequences back to readable text.
  4. Copy the result directly from the output box.

Everything runs locally in your browser — useful when debugging API endpoints that contain sensitive tokens you don't want to paste into third-party services.

Quick checklist

Continue with related resources