URL Encoder & Decoder
Percent-encode text for use in a query string, or decode an encoded component back to readable text.
How to use
- Paste a query value or path segment you want to encode, or a percent-encoded string you want to decode.
- Choose Encode or Decode.
- Copy the result. A broken % sequence shows an error instead of silently corrupting the text.
How it works
URL encoding (percent-encoding) replaces reserved and non-ASCII characters with % followed by two hex digits. A space becomes %20.
This page uses encodeURIComponent and decodeURIComponent, which encode almost every reserved character so the value is safe as a query parameter or path segment.
That is different from encodeURI, which leaves : / ? # and similar characters alone because it is meant for a full URL. Invalid sequences such as a trailing % raise an error instead of silently corrupting the string.
Formula
encode = encodeURIComponent(text) decode = decodeURIComponent(text) space → %20 & → %26 Unicode → UTF-8 percent bytes
Worked examples
Query value with spaces
hello world → hello%20world
Symbols
a&b=c → a%26b%3Dc
Useful notes
- Use this for a single component, not an entire URL you still want to keep as a URL.
- Malformed % sequences are reported, not guessed.
- Encoding stays in your browser and is not sent to analytics.
FAQ
- What is percent encoding?
A way to write characters that are not allowed raw in a URL by replacing them with % and two hex digits. A space becomes %20.
- Why not encodeURI?
encodeURI leaves URL punctuation intact. encodeURIComponent is the usual choice when you are encoding one field.
- What if the encoded text is broken?
decodeURIComponent throws on invalid % sequences. This page shows that error and leaves your input unchanged.
- Is the URL uploaded?
No. Encoding stays in your browser and is not sent to analytics.
Guides
Related tools
Base64 Encoder / Decoder
Encode and decode Base64 in your browser with proper UTF-8 support, including Unicode and emoji.
Slug Generator
Turn a title into a URL-friendly slug. Latin accents including Swedish å, ä and ö become ASCII letters.
JSON Formatter
Pretty-print, minify or validate JSON in your browser. Parse errors show an approximate line and column.
QR Code Generator
Create static QR codes for URLs, Wi-Fi, text, email, SMS and contacts. Download PNG or SVG in your browser — no signup.
See all Utilities tools.