URL Encoder & Decoder for Form Data
Encode or decode text, build the application/x-www-form-urlencoded body a form sends, or paste a body or URL to see every field decoded. Nothing you type is sent to a server.
Form style matches what a browser sends for application/x-www-form-urlencoded. Without it, Encode uses encodeURIComponent, which writes a space as %20.
How form data is encoded
When a form posts with the default enctype, the browser joins each field as name=value and separates fields with &. To keep that structure safe, it encodes every name and value:
encodeURI is a different tool: it encodes a whole URL and leaves &, =, ? and / alone, so it can't make a value safe. Use encodeURIComponent for one value, or URLSearchParams to build a full form body with spaces as +.
URL encoding FAQ
Why does a form turn spaces into + instead of %20?
The application/x-www-form-urlencoded format comes from early HTML forms, which wrote a space as +. Browsers still do this when a form posts with the default enctype, and URLSearchParams does the same. Servers that read form bodies turn + back into a space. In other parts of a URL, a space is written %20.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for a whole URL, so it leaves characters like : / ? & = and # alone. encodeURIComponent is for one value, so it escapes those too. Use encodeURIComponent (or URLSearchParams) for form field names and values, or an & inside a value will split it into two fields.
How are non-English characters encoded?
The text is first turned into UTF-8 bytes, then each byte is written as % and two hex digits. For example, é is two bytes and becomes %C3%A9, and an emoji is four bytes.
Why do I get an 'Invalid percent-encoding' error when decoding?
Every % must be followed by two hex digits, and the bytes must form valid UTF-8. A stray % (as in 100%) or a cut-off sequence like %E2%82 can't be decoded. Encode a literal percent sign as %25.
Is anything I paste sent to a server?
No. Encoding, decoding, building and parsing all run in your browser with the built-in encodeURIComponent, decodeURIComponent and URLSearchParams. Nothing is sent or stored.
Related
More free form tools
Form backend cost calculator
Enter monthly submissions and compare the cheapest listed plan across eight form backends.
Email deliverability checker
Enter a domain to check its SPF, DMARC and MX records and get a plain-English fix for each.
SPF record checker
Look up a domain's SPF record, see each mechanism explained and count DNS lookups against the 10-lookup limit.
DMARC record generator
Pick a policy and report address and copy a ready _dmarc TXT record.
DMARC checker
Look up a domain's DMARC record and see the policy and every tag explained.
DKIM record checker
Enter a domain and selector to check its DKIM key, with presets for common senders.
SPF record generator
Tick your email providers and copy one SPF TXT record with a lookup count.
Contact form spam checker
Paste form HTML to audit its honeypot, endpoint, CAPTCHA markers and spam resistance.
Honeypot field generator
Generate a hidden anti-spam input with your chosen name and hiding technique.
Form action URL tester
Check a form action URL for reachability, CORS headers, POST acceptance and backend.
Email obfuscator
Encode your email so spam scrapers can't read it but people can still click it.
Mailto link generator
Build a mailto: URL with recipients, CC, BCC, subject and a pre-filled body.
Alphanumeric regex tester
Test letters and numbers only, spaces, handles and Unicode; copy validation patterns.
Email regex tester
Test the WHATWG email regex and two other patterns against edge cases and your own list.
Phone number regex tester
Test numbers against E.164, US/Canada and digits-only patterns and copy code snippets.
ZIP code regex tester
Test US ZIP, ZIP+4, Canadian and UK postal codes and copy the regex or HTML pattern.
Number regex tester
Test digits, decimals, money and thousands separators and copy validation patterns.
Date regex tester
Test dd/mm/yyyy, mm/dd/yyyy and ISO dates with leap-year checks and copy JS or HTML patterns.
Name regex tester
Test name patterns for O'Brien, accents and Unicode letters; copy JS or HTML pattern snippets.
Username regex tester
Test username presets for GitHub, Instagram and X; check reserved names and copy JS or HTML patterns.
IP address regex tester
Test IPv4, IPv6, CIDR and private-range patterns and copy JS or HTML pattern snippets.
URL regex tester
Test website URLs against http(s) regex patterns and new URL(), and copy JS, HTML or PHP code.
HMAC-SHA256 generator
Generate and verify webhook signatures for common providers in your browser.
Password regex generator
Pick strength rules, test passwords live and copy the regex or HTML pattern.
UTM builder
Build campaign URLs with UTM parameters, tag a CSV in bulk and check tagged links.
HTML to JSX converter
Paste HTML and get JSX or a working React/Next.js form component.
Image to Base64 converter
Convert images to Base64 data URLs in your browser and copy HTML and CSS snippets.
Base64 to image converter
Paste a Base64 data URI to preview and download the decoded image.
Base64 decode & encode
Decode Base64 to readable UTF-8 text or encode text to Base64, locally in your browser.
URL to Base64 converter
Fetch a direct image URL in your browser and get its Base64 data URL.
HTML form generator
Build a form visually and copy HTML, React JSX or Tailwind code.
AI form generator
Describe your form in plain English and copy working HTML.
Time regex tester
Test 24-hour, AM/PM and ISO time patterns and copy JavaScript, Python or HTML snippets.
Credit card regex tester
Test Visa, Mastercard 2-series, Amex and more card patterns with brand detection and a Luhn check.
Hex color regex tester
Test #RGB, #RRGGBB and alpha hex colors plus rgb() and hsl() values with live color swatches.
UUID regex tester
Test UUID v1-v8, nil/max and GUID formats with version and variant checks; copy JS or HTML patterns.