Back to Developer Tools

URL Encoder & Decoder – Fix Broken Links Instantly

Convert special characters to URL-safe format and decode messy encoded strings

Enter URL or text
Percent-encoded or decoded output

Quick Guide: When to Encode vs Decode

Use Encode when you're building URLs with special characters, spaces, or non-English text. Use Decode when you receive a messy encoded URL and need to read what it actually says.

Encode before: Adding search terms to URLs, building API calls, sharing links with special characters
Decode when: Debugging URL parameters, reading analytics data, understanding encoded links from other systems
Pro tip: Modern browsers encode automatically, but servers don't - always encode on the way out

URL encoding isn't random - it follows specific rules developed back when the web was being built. Think of it as a translation system that converts "unsafe" characters into a format that won't break anything. The system is called "percent-encoding" because every encoded character starts with a percent sign.

The Safe Character Shortlist

Only these characters can appear in URLs without encoding:

• A-Z, a-z, 0-9 (basic letters and numbers)
• - _ . ~ (hyphen, underscore, period, tilde)
• Reserved but sometimes safe: ! * ' ( ) ; : @ & = + $ , / ? % # [ ]

Everything else gets encoded. A space becomes %20 (that's ASCII code 32 in hexadecimal). An ampersand (&) becomes %26. Even the percent sign itself gets encoded as %25 when it's not part of an encoding sequence. This prevents confusion - the system needs to know whether %20 means "a space" or literally the characters "%20".

The encoding process is actually two steps: first, your text gets converted to bytes using UTF-8 (which handles all languages and emojis). Then each byte that's not on the safe list becomes % followed by two hexadecimal digits. Two digits because we're working with bytes, which range from 00 to FF in hex.

Why hexadecimal? It's compact and unambiguous. Early web engineers chose it because it's easy to parse programmatically and creates reasonably short encoded strings. Each percent-encoded sequence is exactly three characters long (% plus two hex digits), which makes decoding straightforward - find %, take next two characters, convert from hex to decimal, you've got your original byte back.