Skip to content
UniKit

JSON to Cookie String

Turn a JSON object into a name=value; cookie string. Keys and values are URI-encoded and non-string values are JSON-serialised first, so separators inside values never break the result.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

JSON input

The top level must be a JSON object. Keys and values are encodeURIComponent-encoded and non-string values are JSON-serialised first, so ; and = inside a value cannot break the Cookie string.

Cookie string

A name=value cookie string joined with "; ", ready for document.cookie or a request header.

Paste a JSON object to see the cookie string

What this tool does

  • Turn a JSON config into a Cookie string for document.cookie or a request header
  • Rebuild a curl/Postman-ready cookie string from cookie JSON captured in a proxy

Example

Input

{"session":"abc123","theme":"dark"}

Output

session=abc123; theme=dark

Keys and values are URI-encoded; non-string values are JSON-serialised first.

Frequently asked questions

Can semicolons or equals signs break the output?

No. Keys and values go through encodeURIComponent, so ; becomes %3B, = becomes %3D and % becomes %25 — the result is always a valid multi-cookie string.

How are non-string values handled?

They are JSON.stringify-ed before encoding: the number 1 gives 1, true gives true and {"x":1} gives %7B%22x%22%3A1%7D. Read them back with JSON.parse(decodeURIComponent(...)).

Are cookie attributes generated?

No. Only name=value pairs are produced; Path, Domain, Max-Age and security flags must be added by you.

Does it touch my browser cookies?

No. It only renders JSON into a string; nothing is written to document.cookie and no request is made.

Keywords:json to cookiedocument.cookie

Related tools