gizmobench
BrowseDaily

Form URL Encoder and Decoder

This page opens Form and Decode for one application/x-www-form-urlencoded field value. A plus becomes a space, while %2B becomes a literal plus. Type in the Decoded box or select Encode to prepare a field value for submission; the tool keeps the distinction between a space and a typed plus.

Direction
Mode

Decoding as a Form field: a plus becomes a space, and %2B becomes the plus that was typed into the form.

  • day%2Fnightcomponent mode
    day/night
  • The same in full URI modereserved escapes kept
    day%2Fnight
  • a+b in form modea plus reads as a space
    a b
  • %E0%A4a truncated sequence
    The sequence at position 1 ("%E0%A4") starts a character UTF-8 writes in 3 bytes, but only 2 of them are here. Paste the rest of the sequence, or delete it.

Type in either box: editing the encoded side decodes, editing the decoded side encodes. Swap sends the text you have to the other box, which is the fix for a paste that went in the wrong one. Positions in an error message count characters from the start of the box, beginning at 1.

Which mode, and why it changes the answer. Component is for one piece of a URL: a query value, a path segment, a fragment. It escapes the characters that separate the parts of an address, so a value holding a slash or an ampersand cannot be mistaken for the structure around it. Full URI is for a whole address: it leaves those separators alone, so the link still reads as a link after a round trip, which also means %2F stays written as %2F. Form is for a field a browser submitted, where a space is written as a plus and a plus that was really typed is written as %2B.
Accuracy. Exact, and the mode decides the answer. Component mode escapes the characters that separate the parts of a URL, which is what a query value needs; full URI mode leaves them alone so a whole address survives a round trip; form mode treats a plus as a space, which is right for form submissions and wrong everywhere else.

Common questions

Why does a+b decode to a b in Form mode?
Form submissions write spaces as plus signs. A literal plus must be %2B, so a%2Bb decodes to a+b. Component and Full URI treat + as a literal plus instead. Select the rule used by the input rather than guessing from its characters.
Does this parse an entire form body or submit a form?
No. It converts one supplied field value. A complete body has key/value pairs joined by & and =, which must be separated before values are decoded. This tool does not parse those pairs, create JSON, submit a request or contact a URL.
Which characters differ from Component mode?
Form encoding keeps ASCII letters, digits, *, -, . and _, writes spaces as +, and percent-encodes other bytes. For example ! and ~ are escaped here. A typed plus becomes %2B. These rules are checked against the browser's URLSearchParams serializer.

Exact, and the mode decides the answer. Component mode escapes the characters that separate the parts of a URL, which is what a query value needs; full URI mode leaves them alone so a whole address survives a round trip; form mode treats a plus as a space, which is right for form submissions and wrong everywhere else.