Base64 -> JSON converter for cookie
Base64 ↔ JSON Converter
Choose a mode and paste your data. The result will appear in the second field automatically.
Base64 Cookie to JSON: How to Decode It and Why You Need It
Many websites store session data, tokens, and user settings in cookies using Base64. It looks like a long string of letters, digits, and symbols, but inside there is plain JSON. If you work with cookies manually, through DevTools, or with parsers, it helps to convert Base64 into readable JSON and back quickly. The converter above is ready to use. Below is what Base64 is, why it is used in cookies, and what to watch out for when working with such data.
1. What Base64 Is in Simple Terms
Base64 is a way to represent any binary data as text. The alphabet consists of 64 characters: A-Z, a-z, 0-9, plus two extra characters (usually + and /), and the = sign is used for padding. Such text can be safely sent over HTTP, embedded in JSON, cookies, and URLs without breaking due to non-printable characters.
Base64 does not encrypt data. It is encoding, not encryption. Anyone who gets the string can decode it in a second. So Base64 does not protect information; it only makes it convenient for storage and transfer.
2. Why Cookies Are Stored in Base64
By standard, cookies cannot contain spaces, commas, semicolons, and some other characters. If a website tried to put raw JSON with quotes, colons, and curly braces there, the browser would either truncate the value or the cookie would not be saved at all. Base64 solves this problem: the result consists only of safe characters.
In addition, Base64 is convenient for:
Session tokens that contain structured data (JWT consists of three Base64 blocks separated by dots).
Storing JSON with user settings, theme, language, and identifiers.
Passing complex objects between the server and the client without extra headers.
Compatibility with legacy systems that cannot handle binary cookies.
3. What a Base64 Cookie Looks Like in Practice
Open any website, press F12, go to the Application -> Cookies tab. You will see a list of cookies with names and values. Some values will look like plain text, and some like a long string such as:
eyJ1c2VySWQiOiIxMjM0NSIsInJvbGUiOiJhZG1pbiIsImxhbmd1YWdlIjoicnUifQ==
Copy it and paste it into the converter above, click Base64 -> JSON. You will get:
{
"userId": "12345",
"role": "admin",
"language": "ru"
}
Simple as that. There are no secrets in Base64. If someone claims that their cookie data is encrypted but it is only Base64, that is a misconception.
4. Where Base64 Appears in Real Services
Discord stores part of its session data in Base64. JWT tokens (used almost everywhere: Google, GitHub, Auth0) consist of two Base64 blocks with JSON inside and one block with a signature. Many PHP frameworks (Laravel, Symfony) serialize cookies through Base64. Some CMS platforms (WordPress, Bitrix) also use Base64 to store serialized data.
If you work with APIs, automation, or just want to understand what is in your cookie, the converter above will save you time.
5. How to Decode a Base64 Cookie Manually
If the converter is not at hand, you can decode the string directly in the browser. Open DevTools (F12), go to the Console tab, and type:
atob('eyJ1c2VySWQiOiIxMjM0NSJ9')
Press Enter. The browser will return the decoded string. If it contains JSON, you can wrap it in JSON.parse right away:
JSON.parse(atob('eyJ1c2VySWQiOiIxMjM0NSJ9'))
And you will get a ready object. The reverse operation is done via btoa:
btoa(JSON.stringify({ userId: "12345" }))
This works for Latin characters and digits. If the data contains Russian or other languages, you will need additional processing through TextEncoder and TextDecoder. That is exactly what the converter above does.
6. Common Mistakes When Working with Base64
The string is truncated. Base64 may contain = characters at the end for padding. If you remove them, decoding may fail.
Spaces and line breaks. Some services add line breaks every 76 characters. It is better to remove them before decoding.
URL-safe Base64. In URLs and cookies, + is sometimes replaced with - and / with _, and = is removed. This variant needs to be converted back to the standard form first.
Double encoding. Sometimes a string is Base64-encoded twice. If the first decode produces another Base64 string, try decoding again.
Not JSON but another format. Inside there may be not JSON, but a serialized PHP object, MessagePack, or plain text. The converter will show whatever is actually inside.
7. Security: What to Keep in Mind
Base64 is not encryption. If the cookie holds a token or a session ID, anyone who gains access to the cookie can use it. Do not share your cookies with third parties and do not paste them into untrusted websites.
If you work with someone else's cookies (for example, in testing or analysis), make sure you have permission to do so. It may violate data protection laws.
Do not store sensitive data in cookies in plain form or in Base64. Passwords, card numbers, and access tokens should stay on the server, not in the user's browser.
Conclusion
Base64 in cookies is a common way to wrap JSON or binary data into browser-safe text. You can decode it in a second using the converter above or via atob in the browser console. The main thing to remember is that Base64 does not protect data; it only makes it convenient to transfer. If you find something important in a cookie, it is better to change your password and check whether your sessions have been leaked.
Keywords: base64 to json, base64 converter, decode base64, base64 cookie, base64 decode online, base64 to text, json to base64, base64 encoder decoder.


