JSON URL Encoder and Decoder
Percent encode a JSON document so it survives a query string, or decode one back into the document it came from.
JSON
Colorazione sintattica disattivata.
Encoded
Colorazione sintattica disattivata.
Il risultato appare qui.
Funziona interamente nel tuo browser.
Su questo strumento
A URL cannot carry a JSON document as it stands. Braces, quotes, spaces and everything above ASCII have to be percent encoded first. This encodes the way encodeURIComponent does, one UTF-8 byte at a time, leaving alone only the characters that are safe anywhere in a URL. Decoding gathers the bytes and reads them as UTF-8 once at the end, which is what stops one accent arriving as two replacement characters. The single option is the difference between a query string and a form submission: in a form a space is written as a plus sign, and everywhere else a plus sign means a literal plus. Assuming the wrong one is the most common way an encoded document arrives corrupted, so it is a toggle rather than a guess. Failures are kept apart too: a percent sign without two hexadecimal digits after it is reported at the character it sits on, and bytes that do not decode to text are reported as their own problem.
Come usare
- Choose Encode or Decode, then paste your document into the left pane.
- Turn the plus sign option on if the text came from, or is going into, a form submission.
- Press Convert, then copy the result or download it as a file.