The Cookie to JSON Converter accepts a large Cookie request-header text of up to 100,000 UTF-16 code units and rejects anything larger without truncating, sampling, or partially returning it.
For a large-text workflow, the input and output have separate hard ceilings. A valid 100,000-code-unit input is accepted only if its complete result fits the 200,000-code-unit output limit. Both directions run entirely in the current browser tab, and pasted data is never sent to Lizely or another service.

What counts as large text
The input cap is measured in UTF-16 code units, not bytes or cookie-pair count. It follows the browser string-length measure used by the converter: a basic character normally uses one code unit, while a character outside the Basic Multilingual Plane normally uses a surrogate pair. Check the actual pasted length rather than estimating it from a file's displayed kilobytes.
| Measure | Accepted maximum | Rejection behavior |
|---|---|---|
| Input in either direction | Exactly 100,000 UTF-16 code units | At 100,001 code units, the input is rejected |
| Complete output | Exactly 200,000 UTF-16 code units | Any larger, invalid, or zero-length output is rejected |
| Failed conversion | No partial result | The previous successful result is removed before the error appears |
Reaching the input ceiling does not guarantee completion. Cookie-to-JSON output adds JSON punctuation and two-space indentation, so an accepted input can produce output beyond 200,000 code units. That complete output is rejected. The editor does not use maxLength to silently block typing; instead, the conversion check rejects invalid, zero-length, or oversized results without slicing, sampling, skipping, or returning only part of the input.
The scope is request-header text, as defined for Cookie in RFC 6265, rather than browser-storage exports or Set-Cookie response rules.
Convert a large Cookie header to JSON
- Open the Cookie to JSON Converter, choose Cookie to JSON, and paste one strict bare Cookie request value, such as SID=abc; lang=en-US. You may instead use an exact Cookie: prefix followed by the value. The field name is case-insensitive, but no space is allowed between Cookie and the colon.
- Review the structure before converting. Every pair must use name=value, and multiple pairs must be separated by exactly a semicolon followed by one ASCII space. Do not add spaces around the equals sign, omit the separator space, use multiple separator spaces, or leave a trailing semicolon. Confirm that the complete pasted input remains within 100,000 UTF-16 code units.
- Select Convert. If the tool reports an error, correct the source instead of accepting a partial result. An error clears the previous successful output and does not skip invalid pairs or publish a shortened conversion.
- Review every preserved string and the displayed pair count against the source. Once confirmed, copy the complete output from the read-only plain-text area.
If clipboard permission is denied, the complete output remains visible for manual selection. Editing the input or changing direction clears the prior output, error, pair count, and clipboard status, preventing an earlier result from remaining attached to the new input.
Build Cookie text from a large JSON map
The reverse mode is equally strict: JSON-to-Cookie accepts exactly one nonempty JSON object whose decoded keys and string values match the Cookie profiles. It does not convert an array of cookie objects or a general JSON document into a Cookie request-header value.
- Choose JSON to Cookie and paste exactly one nonempty, flat JSON object. Every property value must be a JSON string.
- Remove values that the converter cannot represent, including numbers, booleans, null, arrays, nested objects, comments, trailing commas, and text after the object. Names and string values are validated after JSON string escapes have been decoded.
- Select Convert. Duplicate decoded names are rejected rather than overwritten, including escaped spellings that resolve to the same name. The names __proto__, prototype, and constructor are blocked in both directions.
- Review the resulting pairs and copy the complete local output. Accepted pairs are joined with the same exact semicolon-plus-one-space separator. JSON member order is retained for convenience, but Cookie semantics should not depend on serialization order.
JSON-to-Cookie output cannot exceed its input length, so input within the 100,000-code-unit limit cannot exceed the 200,000-code-unit output limit. For a compact review of the accepted pair format, use the strict RFC 6265 pair-format cheat sheet.
What strict parsing catches in long inputs
A large input is not processed more loosely than a short one. The converter rejects malformed structure instead of guessing which spacing or duplicate was intended.
| Input pattern | Result | Reason |
|---|---|---|
| SID=abc; lang=en-US | Accepted | Valid pairs with the required separator |
| Cookie:SID=abc; lang=en-US | Accepted | Exact optional field-name prefix |
| preference= | Accepted | An empty cookie value is valid |
| SID = abc | Rejected | Spaces around the equals sign |
| SID=abc;lang=en-US | Rejected | Missing separator space |
| SID=abc; lang=en-US | Rejected | Multiple separator spaces |
| SID=abc; | Rejected | Trailing semicolon |
| SID=abc;; lang=en-US | Rejected | Empty pair |
Only the first equals sign in a pair is structural, so a value such as abc== retains its additional equals signs. Names must satisfy the RFC token profile and remain case-sensitive; SID and sid are different names. Duplicate names are rejected case-sensitively instead of using first-wins or last-wins behavior.
Values must be an unquoted sequence of permitted cookie octets or the same sequence wrapped in double quotes. Raw spaces, commas, semicolons, backslashes, controls, and other forbidden characters fail. Quote characters surrounding an accepted quoted value are retained because they are part of the serialized Cookie field value. Only outer ASCII spaces around the entire pasted line are ignored for convenience.
What stays literal through conversion
Percent sequences are not URL-decoded, escaped, normalized, or interpreted: %2F remains the three characters percent, 2, and F. Additional equals signs in a value, signed tokens, query strings, and permitted URLs remain value data because splitting stops at the first equals sign.
In JSON-to-Cookie mode, JSON string escapes are decoded before Cookie validation. Consequently, an escaped newline fails because the decoded control character is not valid cookie-value data. The converter does not automatically quote forbidden characters, remove quotes, sort members, percent-encode values, or generate Set-Cookie attributes.
Cookie-to-JSON uses a null-prototype internal map, while the prototype-risk names remain blocked in both directions. That boundary reduces one class of downstream risk, but it is not a guarantee that arbitrary JSON handling is secure; consumers must still parse and merge untrusted data safely.
Cookie request text is not Set-Cookie
The converter handles the Cookie request field only. It does not parse Set-Cookie response headers and does not treat Domain, Path, Expires, Max-Age, Secure, HttpOnly, SameSite, Partitioned, Priority, or extension attributes as request cookies. Those attributes are supplied by a server in Set-Cookie and are not returned by the browser in the Cookie request field. Pasting an exact Set-Cookie: prefix therefore produces an explicit error rather than misleading JSON.
A Cookie header cannot reveal a cookie's expiry, permitted hosts, permitted paths, secure-only state, or HttpOnly state. The tool also does not read document.cookie, modify the browser cookie store, inspect browser storage, or make an HTTP request; it transforms only the text you paste.
Review sensitive values before sharing
Local processing keeps the pasted header in the current browser tab, but it does not make session data harmless. Cookie headers often contain live session secrets. Keep converted output private, and rotate credentials that have been exposed. The converter is not a credential sanitizer and cannot decode an application's session format or decide whether a cookie is secure.
- Confirm that the source is a Cookie request field rather than a Set-Cookie response.
- Compare the displayed pair count with the source and review every preserved string.
- Check quoted values, percent sequences, URLs, and extra equals signs for unexpected content.
- Do not publish live authentication data in a shared issue, log, or chat message.
If you're weighing options, CSV to Excel API Alternative: Local Browser Workflow covers this in detail.