URL-encoded Form to JSON

← All tools

Convert an application/x-www-form-urlencoded body to JSON, or a JSON object of fields back to that body. Repeated names become arrays.

The body never leaves the browser. Nothing is uploaded. Direction and minify are stored in the URL. The body is not.

Open file…

Options

Direction and minify are stored in the URL. JSON to form uses to=form. Minify uses indent=0. Files up to 1 MB open in the page.

Not converted

Result

The preview is cut at 200,000 characters. Copy and Download include everything.

About this tool

Parsing and serializing use URLSearchParams, which follows the WHATWG URL standard for application/x-www-form-urlencoded. Pairs are split on &. The first = splits the name from the value. A pair with no = has an empty value. Empty pairs from a trailing or doubled & are skipped. A single leading ? is removed, which is howURLSearchParams reads a query string. A second? stays in the name.

A plus sign is a space. A percent sign followed by two hex digits is one byte, then those bytes are read as UTF-8. A percent sign that is not followed by two hex digits stays as written, so %ZZ stays%ZZ. On the way back, space is written as +. Letters, digits, and the characters * -. _ stay as themselves. ~ is percent-encoded. @ becomes %40.

The JSON shape is this page's mapping, not a standard. One value stays a string. Two or more values for the same name become an array, in order. A one-item array written back comes out as a string, so it does not round-trip as an array. A name that contains brackets stays one key. This page does not build nested objects and does not write bracket notation. A number or a boolean is written with its decimal or word form, and null becomes an empty string. The page says so. A raw line break is rejected. A newline you meant to send belongs in the body as%0A.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →