URL Encode Tool

Transform reserved characters into valid percent-encoded text. Choose RFC modes, preserve lines, and inspect changes. Export clean results with examples, formulas, and practical steps.

Calculator Inputs

Example Data Table

Input Mode Processing Encoded Output
hello world RFC 1738 Whole Text hello+world
a/b?x=10&y=20 RFC 3986 Whole Text a%2Fb%3Fx%3D10%26y%3D20
Zürich & Paris RFC 3986 Line-by-Line Z%C3%BCrich%20%26%20Paris
50% done RFC 1738 Whole Text 50%25+done

Formula Used

Core encoding rule: keep unreserved characters unchanged, and replace every other byte with a percent sign followed by its hexadecimal byte value.

RFC 3986 set: A-Z a-z 0-9 - _ . ~ remain unchanged. Spaces become %20.

RFC 1738 form style: A-Z a-z 0-9 - _ . remain unchanged. Spaces become +.

Byte transformation expression: for each unsafe byte b, output %HH, where HH = hex(b).

Size growth: Growth = Encoded Bytes - Original Bytes. Each encoded byte usually expands from one byte to three characters.

How to Use This Calculator

  1. Paste the text, query value, path fragment, or mixed symbol string into the input box.
  2. Select RFC 3986 for strict URI components, or RFC 1738 for form-style encoding.
  3. Choose whether to encode the entire text or preserve line breaks while encoding each line.
  4. Set hex letters to uppercase or lowercase for preferred output formatting.
  5. Enable preserved percent triplets when existing %XX sequences should stay intact.
  6. Press Encode URL Text to view the result above the form.
  7. Use the copy, CSV, or PDF buttons to save the transformed output and supporting table.

FAQs

1. What does URL encoding do?

It converts reserved or unsafe characters into percent-based escape codes. This helps browsers, forms, and servers read spaces, symbols, and non-ASCII text consistently inside URLs.

2. When should I choose RFC 3986?

Choose RFC 3986 when you need strict URI component encoding. It keeps tilde unchanged and converts spaces to %20, which is common for APIs and modern link handling.

3. When should I choose RFC 1738?

Choose RFC 1738 for form-style submission behavior. It turns spaces into plus signs, which is often expected in classic query strings and application form processing.

4. Why can encoded text become much longer?

Every unsafe byte usually expands to three characters such as %2F. Multibyte UTF-8 characters can expand even more because each byte becomes its own percent triplet.

5. What does line-by-line processing change?

It encodes each line separately and keeps visible line breaks between rows. Whole-text mode encodes newline bytes too, so line breaks become percent codes in the output.

6. Why preserve existing %XX sequences?

This helps avoid double encoding. For example, an existing %20 can remain unchanged instead of turning into %2520, which is useful when text already contains encoded fragments.

7. Does this tool handle international characters?

Yes. UTF-8 bytes are encoded individually, so characters like ü, é, or Arabic letters become valid percent triplets that can travel safely through URLs.

8. What can I export from the result section?

You can copy the encoded text, download a CSV containing line details, or create a PDF snapshot of the result section for records, testing notes, or documentation.

Related Calculators

mnemonic phrase generatorcaesar cipher toolsha256 hash generatorrsa encryption toolrsa key generatorrsa decryption toolpgp decrypt toolmd5 hash generatorurl decode toolproof of stake

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.