Encode and decode URLs
Turn special characters into the safe form used in web addresses.
Calculator inputs
Results
Enter your values and press “Calculate” to see the result.
In short
- What it calculates
- Turn special characters into the safe form used in web addresses.
- Formula used
Space → %20- Example
- The text “VAT & withholding calculation” is encoded as:
URL encoder and decoder
Web addresses only allow a limited set of characters. Spaces, accents, ampersands and question marks must be replaced before travelling across the network.
This tool applies and reverses that substitution.
How it works
Each disallowed character is replaced by a percent sign followed by its hexadecimal value in UTF-8. A space, for instance, becomes %20.
Formula
Space → %20
Accent (á) → %C3%A1
Ampersand → %26
Worked example
The text “VAT & withholding calculation” is encoded as:
VAT%20%26%20withholding%20calculation
Explanation
Reserved characters have a job to do
The question mark separates path from parameters, the ampersand separates parameters from one another, the equals sign joins name and value, the hash marks a fragment. If one of those symbols appears inside a value unencoded, the browser reads it as structure and the address breaks. Encoding turns it into data.
Why an accent takes two sequences
Encoding works on bytes, not letters. In UTF-8 an accented letter takes two bytes, and each byte becomes a percent sign plus two digits. That is why ñ appears as two groups and an emoji can take four.
The space has two forms
In a path it is encoded as percent twenty. In form data sent with the classic method a plus sign is used. Both are correct in context, and mixing them produces subtle errors where spaces turn into literal plus signs.
Do not put personal data in the address
Addresses are recorded in browser history, in server logs and in referrer headers sent to third parties. Any sensitive data belongs in the body of a request, never in the query string.
Frequently asked questions
When is encoding needed?
Whenever a value with spaces, accents or symbols goes inside a URL parameter, otherwise the browser will misread the address.
Why does one accent produce two sequences?
Because in UTF-8 it takes two bytes, and each byte is encoded separately with its own percent sign.
Why does an accent become two sequences?
Because encoding operates on bytes and in UTF-8 an accented letter takes two. Each byte becomes its own percent sequence.
When is a plus sign used for a space?
In form data sent with the classic encoding type. In a URL path, a space is encoded as percent twenty.
Need to calculate something else?
These tools are often used alongside this calculator.
Base64
Turn text into Base64 and recover the original text.
Slug generator
Turn a title into a clean URL with no accents or odd characters.
Base converter
Convert numbers between bases 2, 8, 10, 16, 32 and 36.
Passwords
Random passwords with calculated entropy, generated in your browser.
Colours
Convert between colour formats and check contrast against white.
Timestamp
Convert between Unix timestamps and readable UTC dates.