HTML Form URL Encoding (Spaces as +)

Encode text the way HTML forms do: spaces become +, and other reserved characters become %HH. application/x-www-form-urlencoded.

Part of the free URL Encoder. Runs in your browser — nothing is uploaded.

HTML Form URL Encoding (Spaces as +)

HTML forms that POST as application/x-www-form-urlencoded replace spaces with + instead of %20. The rest of the encoding matches encodeURIComponent. Use this when you are rebuilding a form body by hand.

Worked example: A form field

Text

Ada Lovelace

Encoded

Ada+Lovelace

Practical tip

When decoding, turn + into a space before decodeURIComponent, or the plus survives as a literal +.

How to use this URL Encoder

  1. 1Use the live tool above — it runs entirely in your browser and never uploads your data.
  2. 2Paste the sample from the worked example, or use your own input.
  3. 3Copy the result, then adapt the same steps in your editor, script, or pipeline.

HTML Form URL Encoding (Spaces as +) FAQs

Is + valid in a URL query?

Many servers treat + in a query as a space because of form encoding. %20 is unambiguous.

Does fetch encode like a form?

URLSearchParams does. A raw JSON body does not — that is a different content type.