Guides

How JSON, Base64, JWT and hashes differ

JSON, Base64, JWT and hashes often appear in the same debugging session, but they do not replace one another. In one sentence: JSON is a data structure, Base64 is a textual representation of bytes, JWT is a container for claims, and a hash is a fixed-length fingerprint of input.

JSON gives data a structure

JSON represents objects, arrays, strings, numbers, booleans and null. Pretty-printing it or placing it on one line does not normally change the data model, but changing key order or numeric spelling does change the original bytes. That matters when the exact bytes are signed: sorting or reformatting signed JSON can make a signature fail even when the displayed values look equivalent.

Converting CSV to JSON also requires judgment. A postal code such as 00123 loses leading zeros if treated as a number. A date-looking field may be only a string with no time zone. After conversion, validate the structure and deliberately choose the types that application code expects.

Base64 is representation, not secrecy

Base64 writes arbitrary bytes with a restricted ASCII alphabet. It is useful when a text-only format such as JSON or email must carry an image or other binary value. Anyone can reverse it immediately, so it does not protect passwords or personal information. Base64url is a related alphabet designed for URLs; it replaces troublesome characters and may omit padding.

Encoding does not make a file smaller. Base64 typically adds roughly one third to the byte count, and a Data URI adds a media type and prefix as well. If the goal is compression, optimize the source file instead.

Reading a JWT is not validating it

The header and payload of a common dot-separated JWT are Base64url-encoded JSON, so anyone can decode them. Decoding only reveals the claims. It does not prove who issued the token. Trust requires verifying the signature with an allowed algorithm and the correct key, then applying application rules to claims such as exp, nbf, iss and aud.

Even a browser-only decoder deserves care. A live access token may be exposed through screen sharing, clipboard history or an extension. Use expired test tokens when possible and never mistake a readable payload for an authenticated identity.

A hash is not a reversible conversion

A hash produces a fixed-size result regardless of the input size. It is useful for comparing files or confirming that a download has not changed. There is no decoding step that reconstructs the input. Password storage needs a dedicated password-hashing construction with a salt and work factor, not one fast SHA-256 operation.

HMAC combines a shared secret key with a hash to authenticate data. It can show that someone holding the key produced the value and that the message did not change, but it still does not hide the message.

Choose by the job

Job Use
Exchange structured values JSON
Carry binary bytes in a text field Base64
Carry signed claims JWT plus validation
Compare file contents A hash such as SHA-256
Prepare spreadsheet data for code CSV to JSON, validate, then generate types

The recommended connections below focus on that final workflow: one spreadsheet export becomes readable validated JSON and matching code types without manual copying between tools.

Try a recommended connection

These ready-made connections apply the choices explained above and pass each result to the next tool in your browser.

Turn a spreadsheet export into JSON and ready-to-use code types

A CSV from Excel or Sheets becomes JSON a program can read, checked and laid out, and then type definitions to paste into code.

  1. CSV
  2. JSON
  3. JSON to Code

You get: The same data as validated JSON, and code types for it.

Start with CSV

One spreadsheet export, two files: tidy JSON and code types

Convert a CSV once, then give the person who reads the data and the person who writes the code what each of them needs.

  1. CSV

You get: The data as readable JSON, and code types for it, side by side.

Start with CSV

Tools for this

Sources

Last updated: