URL Encoder / Decoder
Encode & decode URLs
What Is This Tool?
This tool percent-encodes (URL-encodes) text so it can be safely included in a URL, or decodes a percent-encoded string back to readable text. It uses your browser's built-in encodeURIComponent and decodeURIComponent, so it correctly handles spaces, special characters, and non-ASCII text.
How to Use
Type or paste text into the Text field, then click Encode.
Or paste a percent-encoded string into the URL Encoded field and click Decode.
Use Swap to flip the two fields' contents.
Copy either field's contents with its own Copy button.
Features
- Correct handling of spaces, symbols and non-ASCII characters
- Instant encode and decode
- Swap the two fields with one click
- Friendly error message on malformed percent-encoding
- 100% client-side — nothing leaves your browser
Examples
Text: name=José Silva&city=São Paulo
URL Encoded: name%3DJos%C3%A9%20Silva%26city%3DS%C3%A3o%20Paulo
Common Use Cases
- Building a query string with user-provided values
- Decoding a query parameter to inspect its real value
- Safely embedding special characters like & and = in a URL
- Debugging why a link with spaces or accents doesn't work
Frequently Asked Questions
Why can't I just put spaces and symbols directly in a URL?
URLs can only safely contain a limited character set. Spaces, ampersands, equals signs and non-ASCII characters must be percent-encoded so they aren't misread as part of the URL's structure.
Does this encode the whole URL or just a component?
It uses encodeURIComponent, meant for encoding individual query parameter values, not a full URL (it would also encode characters like / and : that a full URL needs to keep).
Why does Decode fail on my input?
Decoding fails on malformed percent sequences, such as a stray % not followed by two valid hex digits. Double-check the encoded text was copied completely.
Does this handle non-English characters?
Yes, non-ASCII characters are encoded as their UTF-8 percent-encoded byte sequence, and decoded back correctly.
Is my text uploaded anywhere?
No, everything runs locally using your browser's built-in JavaScript functions.