URL Encoder/Decoder
Encode and decode URLs and special characters instantly with smart URL parsing.
URL Breakdown
- Protocol
- Host
- Port
- Path
- Query String
- Fragment
Use Cases
URL encoding and decoding are essential for web development and everyday internet use:
-
Encode Query Parameters
Safely include special characters like spaces, ampersands, and equals signs in URL query strings when building dynamic links.
-
Debug Encoded URLs from Logs
Quickly decode percent-encoded URLs from server logs to understand what URL was actually requested.
-
Fix Double-Encoded URLs
Identify and fix URLs with %2520 instead of %20 by detecting already-encoded input before encoding again.
-
Understand URL Structure
Learn which parts of a URL get encoded and when to use encodeURI vs encodeURIComponent with the visual breakdown.
-
Prepare Text for URL Parameters
Encode text with emoji and special characters to safely append to share URLs across all platforms.
Frequently Asked Questions
- What's the difference between encodeURIComponent and encodeURI?
- encodeURIComponent encodes all special characters including URL delimiters (/, ?, #). Use it for query parameter values. encodeURI preserves URL structure characters and is meant for encoding complete URLs.
- Why do I see %20 instead of + for spaces?
- We use %20 for spaces because it's more universally compatible. The + notation for spaces only works in query strings and can cause issues in other URL parts.
- What is double encoding?
- Double encoding happens when you encode an already-encoded string. For example, %20 (encoded space) becomes %2520. Our tool warns you when this might happen.
- Is my data safe?
- Yes! All encoding and decoding happens directly in your browser. Your data is never sent to any server.
- Why doesn't decoding work on some strings?
- Decoding fails when the input contains invalid percent-encoded sequences, like %GG (invalid hex) or a trailing % without two hex digits.
How to Use URL Encoder/Decoder
How to Use
- Choose your mode: Encode (text to URL) or Decode (URL to text)
- Select encoding type: encodeURIComponent (for query params) or encodeURI (for full URLs)
- Type or paste your text in the input area
- See the result instantly in the output area and click Copy to copy it
Features
- Instant conversion as you type
- Smart URL parsing shows component breakdown
- Double-encoding detection prevents common mistakes
- Swap button to quickly verify by encoding then decoding back
- 100% client-side - your data never leaves your browser
- Your last input is automatically saved
When to Use Each Mode
encodeURIComponent
encodeURIComponent (Recommended for most cases): Encoding query parameter values, Encoding path segments, Any text that will be part of a URL
encodeURI
encodeURI: Encoding a complete URL while preserving its structure, When you want to keep special URL characters like /, ?, #
Keyboard Shortcuts
- Copy output
- Clear input
Tips
- Spaces become %20 (not +) for maximum compatibility
- If you see %25, your input was already encoded
- The URL breakdown shows you exactly which parts get encoded