1. Home
  2. Developer tools
  3. Cookies to JSON

Cookies to JSON

Command-line tools such as curl and yt-dlp read cookies in the Netscape file format, while browser extensions export JSON. Paste either one and convert it, with each field checked and unreadable lines reported.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Cookies to JSON

  1. Choose the direction.
  2. Paste the cookie file or the JSON.
  3. Copy the converted result.

Features

  • Reads the seven tab-separated fields of the Netscape format
  • Handles the HttpOnly prefix
  • Session cookies and Unix expiry times
  • JSON to cookie file in the same tool
  • Reports lines it cannot read
  • Nothing is stored or sent

Supported formats

You can open

  • Cookie file
  • JSON

You get

  • JSON
  • Cookie file

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the Cookies to JSON is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Only the Netscape and Mozilla cookie file format is read, not browser cookie databases.
  • Cookies are credentials; the result should not be shared.

Guide

Converting Netscape cookie files to JSON and back

Command-line programs such as curl, wget and yt-dlp read cookies from a plain text file in a layout that goes back to the Netscape browser. Browser extensions that export cookies often produce JSON instead, and scripts in many languages expect JSON objects. Moving between the two by hand is fiddly because the text format is separated by tabs and reads like a table. This page converts in both directions and reports anything it cannot read.

The file format

The first line is usually a comment, # Netscape HTTP Cookie File, and any line starting with # is ignored apart from one special case. Every cookie occupies a line with seven fields separated by tabs. They are: the domain; TRUE or FALSE for whether subdomains are included; the path; TRUE or FALSE for whether the cookie requires HTTPS; the expiry as seconds since 1970, with 0 meaning a session cookie; the name; and the value. A line that begins with #HttpOnly_ is a cookie that scripts in the page cannot read, and the prefix is stripped from the domain.

The JSON fields

The JSON output follows the names that many browser extensions use: domain, hostOnly, path, secure, httpOnly, session, expirationDate, name and value. The two files describe the same facts in different ways. The subdomain flag and hostOnly are opposites, and a session cookie has no expirationDate in the JSON. Going from JSON to text, the subdomain flag is set from hostOnly and the domain is written exactly as it appears in the JSON, so keep the leading dot in the domain when the cookie should cover subdomains.

Using the page

Pick a direction, paste the cookie file or the JSON, and copy or download the result. Cookies are credentials, so the page holds them only in memory; nothing is written to local storage or sent over the network, and a warning at the top reminds you to treat the output like a password. A count shows how many cookies were read and how many lines were skipped, with the reason for each skipped line, such as a wrong number of fields.

Edge cases

Tabs matter: a file that has had its tabs converted to spaces by an editor cannot be read, and the page reports the lines as skipped. An expiry that is not a number is skipped. JSON input may be an array of cookies or an object with a cookies array. Items that lack a name or a domain are rejected with the item number. Cookie values are kept as written, including characters such as equals signs and percent escapes.

A worked example

The Sample button loads four cookies. session_id is on .example.com, secure, with the expiry 1893456000, and becomes an object with hostOnly false and httpOnly false. theme has an expiry of 0, so the JSON marks it as a session cookie and gives no expirationDate. csrf is on www.example.com with the subdomain flag FALSE, so hostOnly is true, and its path is /account. The last line starts with #HttpOnly_ and becomes a cookie with httpOnly true. Four cookies are read and no lines are skipped.

Limits

Only the Netscape and Mozilla text format and the JSON layout described are supported, not browser cookie databases, encrypted stores or HAR files. The page does not check that cookies are valid, still active or allowed for a site. Keep exported files private and delete them when finished. Use them only with accounts you own, and respect the terms of the sites you use them with.

Checked against the current version of the Cookies to JSON on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

What does the include-subdomains flag mean?

TRUE means the cookie applies to the domain and all its subdomains, which is why the domain is written with a leading dot. FALSE means it applies to that exact host only. In the JSON this is the opposite flag, hostOnly, which is true when the subdomains flag is FALSE.

Why do tools like curl and yt-dlp need this file?

They are not browsers and do not have your logged-in session. A cookie file carries the session cookies from a browser to the tool, so a request or download behaves as if you were signed in. The file is as sensitive as a password.

Is it safe to paste cookies here?

The conversion runs entirely in your browser and the text is not saved. Cookies can still log someone in, so only handle your own and never share the output.

What does an expiry of 0 mean?

A session cookie: it is dropped when the browser closes. The JSON output marks it as a session cookie.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.