Percent-Encoding (RFC 3986) Tool
Enter text and choose encode or decode for strict RFC 3986 percent-encoding.
Result
How it is calculated
In encode mode the text is converted to its UTF-8 bytes and every byte except A–Z a–z 0–9 - . _ ~ is written as %XX, where XX is the byte in hexadecimal. A space becomes %20, never a plus sign. Characters outside ASCII use several bytes, so one letter such as é becomes two sequences (%C3%A9). In decode mode each %XX is turned back into its byte; a plus sign is left as a plus sign, not turned into a space. The length line counts the bytes of the output text. Empty input returns nothing, and the mode defaults to encode if not specified.
Worked example
Encode the text café & tea? (12 bytes, because é takes two). Letters stay as they are. The first space becomes %20, é becomes %C3%A9, the ampersand becomes %26, the second space becomes %20 and the question mark becomes %3F. The result is caf%C3%A9%20%26%20tea%3F, which is 24 bytes long. Switching to decode mode with this string returns the original text.
Common mistakes
- Expecting a space to become a plus sign. This tool follows RFC 3986 and gives %20; plus signs are only a form-encoding convention and are not converted on decode.
- Encoding a whole URL. The slashes, colon and question mark would be escaped and the link would stop working, so encode only the individual parameter values.
- Encoding the same string twice. A % in already-encoded text becomes %25, giving results like %2520 that the server decodes only once.
- Decoding text that contains a stray % not followed by two hex digits; such parts are left as they are, so check the source for typos.
- Reading the length as the input size. It counts the bytes of the output, so an encoded string is longer than the original.
Sources
About this calculator
RFC 3986 defines the syntax of URIs and reserves a small unreserved character set — letters A–Z, a–z, digits 0–9, and the four symbols - . _ ~ — as the only characters that never need escaping. Every other byte, including spaces, reserved delimiters like ? & / #, and non-ASCII characters, must be represented as a percent sign followed by its two-digit hexadecimal byte value (e.g. a space becomes %20), so the resulting string can safely travel inside a URL without breaking its structure.
This tool applies that exact rule set to encode arbitrary text into a URL-safe form, or reverses the process to decode a percent-encoded string back to readable text. Web developers use it when building query strings or redirect URLs by hand, and API developers and QA engineers use it to debug why a request parameter isn't matching what the server expects.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Encode a single value, such as one query parameter, not a whole address: the colon and slashes of a full URL are not in the unreserved set, so they would be turned into %3A and %2F and break it. Spaces come out as %20. Form submissions use a plus sign for spaces, and decoding here leaves a plus untouched, so swap pluses for spaces first when decoding that kind of data. Which text are you encoding?