Form Data to JSON Converter

Paste a form-urlencoded string to convert it into JSON.

How it is calculated

The string is split on & into pairs, and each pair is split at its first = into key and value. Both are percent-decoded with standard URL decoding, so + and %20 become spaces and %25 becomes %. A leading ? is ignored, empty pairs and pairs with an empty key are skipped, and a key with no = gets an empty string as its value. If a key appears again, its values are collected into an array in the order they appear. Every value stays text: age=30 gives the string 30, not a number. The result is pretty-printed JSON, and the count is the number of distinct keys.

Worked example

Input: name=Ada+Lovelace&city=London&tag=a&tag=b&note=100%25+sure. There are five pairs. name decodes to Ada Lovelace (the plus becomes a space), city to London. tag appears twice, so it becomes the array [a, b]. note decodes to 100% sure. Five pairs but only four distinct keys, so the tool reports a key count of 4 and prints an object with name, city, tag and note.

Try this example →

Common mistakes

  • Expecting numbers or booleans: every value is output as a string, so age=30 becomes the text 30 and you must convert types yourself.
  • Pasting a full URL instead of just the query part. Everything before the ? is not stripped, so the first key would include the address; paste only what follows the ?.
  • Assuming repeated keys overwrite each other. Here they become an array, which differs from servers that keep only the last value.
  • Forgetting that a literal plus sign must be sent as %2B; a bare + is read as a space.
  • Expecting bracket names like user[name] to become nested objects. They stay as flat keys with the brackets included.

About this calculator

HTML forms and many APIs submit data as application/x-www-form-urlencoded text — key-value pairs joined with &, keys and values separated by =, and special characters percent-encoded (spaces as + or %20). That flat, order-dependent string is easy for browsers to send but awkward to read or reuse compared to structured JSON, especially once repeated keys like item=1&item=2 need to become arrays.

This tool parses a form-urlencoded string, decodes each key and value, and outputs clean, formatted JSON. Backend developers use it to quickly inspect what a form POST body or query string actually contains, and QA engineers and API testers use it when converting a captured request (from browser dev tools or a proxy like Postman) into a JSON payload for a different endpoint or test fixture.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Everything comes out as text, and repeated keys become arrays. Pasting a=1&a=2&b&c=%E2%82%AC gives a as the list 1, 2, b as an empty string, c as the euro sign, and a key count of 3. If your code expects a number or a boolean, convert it afterwards. Which odd encodings or nested key styles have tripped up your parsing?

Popular calculators

All Calculators