Blazing fast JSON formatter, validator, and minifier for the command line. Built for DevOps and daily development.
- π Overview
- β¨ Key Capabilities
- β‘ Quick Examples
- π³ DevOps & Large Files
- β Why Use jb? (vs jq)
- π₯ Installation
- π Usage
- π§ Technical Details
- β Development Time
- π Why I Created This
- π Contact
JSON Beautify (jb) is a high-performance CLI utility engineered for DevOps Engineers, SREs, and Backend Developers.
While other tools crash when trying to open a 5GB log file or require complex syntax just to read data, JSON Beautify thrives on simplicity and speed. It is designed to handle massive streams of data, CI/CD validation pipelines, and complex log analysis without eating up your RAM.
- β‘ Memory Efficient (Stream Processing): Unlike editors that load the whole file into RAM,
jbuses intelligent buffering. It can process multi-gigabyte files on low-memory machines without crashing. - π οΈ DevOps Ready: Built for pipes (
|). Perfect for chaining withdocker logs,kubectl,grep, andcurl. - π‘οΈ CI/CD Validation: Strict JSON validation mode (
-v) returns proper exit codes (0 or 1), making it perfect for automated pipeline checks. - π Deterministic Output: Sorts keys alphabetically (
-s). This turns random JSON output into predictable structures, makinggit diffpossible. - π NDJSON Support: Natively handles Newline Delimited JSON (standard for server logs) automatically.
Fetch data from an API and format it instantly for reading.
curl -s https://api.github.com/users/octocat | jbSort keys alphabetically to make finding fields easier or for comparing objects.
echo '{"z":9, "a":1}' | jb -s
# Output:
# {
# "a": 1,
# "z": 9
# }Remove all whitespace to save bandwidth or storage space.
jb -i config.json -o config.min.json -cMinify a log stream to make it searchable with grep, then beautify the result.
cat app.log | jb -c | grep "ERROR" | jbJSON Beautify was built to solve the "OOM (Out of Memory) Kill" problem.
Most editors crash here. jb streams it line-by-line.
cat terabyte_server.log | jbInstant formatting for live container streams.
kubectl logs -f my-pod -n production | jbjq is the king of transformation, but jb is the king of visualization.
- Defaults matter: To get a sorted, colored view of a file in
jqwhile piping, you often have to typejq -C -S . | less -R. Withjb, you just typejb. It handles colors and formatting intelligently by default. - Memory Safety:
jqbuilds an object tree in memory. If you feed it a 10GB file without specific streaming flags, it can crash.jbis built on Go'sbufio.Scannerto handle massive streams natively. - Simplicity:
jbdoesn't try to be a query language. It tries to be the best possible viewer.
No dependencies. No NodeJS. No Python. Just one binary.
git clone https://github.com/gigachad80/JSON-Beautify
cd json-beautify
go build -o jb main.go ( Virgin Mac users & Chad Linux users)OR
go build -o jb.exe main.go ( Virgin Windows users )
OR
Directly download from π€π here and set it to PATH
sudo mv jb /usr/local/bin/
Syntax: jb [flags]
| Flag | Description | Default |
|---|---|---|
-i <file> |
Input file path (Reads from stdin if empty) |
- |
-o <file> |
Output file path (Writes to stdout if empty) |
- |
-s |
Sort keys alphabetically (Deterministic output) | false |
-c |
Compact/Minify (Remove whitespace for Prod) | false |
-v |
Validate only (Exit code 0=Valid, 1=Invalid) | false |
-color |
Force color output (Useful for less -R) |
auto |
-indent |
Custom indentation string | (2 spaces) |
- Language: Go (Golang) 1.20+
- Architecture: Stream-based decoder (
json.NewDecoder) rather than loading full payloads (ioutil.ReadAll). - Coloring: Custom Regex-based lexer for high-speed tokenization.
- Buffering: Uses
bufio.Scannerto handle streams of arbitrary size without memory spikes.
Roughly 12 minutes for editing the README, thinking about features, and testing the all options.
This tool was born out of necessity for a personal automation project involving massive datasets.
I needed to process and inspect multi-gigabyte JSON files locally, and existing solutions failed me:
- Online Formatters: I couldn't upload 2GB files to a website (bandwidth limits) and didn't want to expose sensitive data to third-party servers (privacy risk).
- VS Code / Editors: They choked and crashed whenever I tried to open files larger than 50MB.
jq: While powerful, I found the syntax annoying for simple "quick looks," and I needed something that wouldn't eat all my RAM during automated processing.
I developed JSON Beautify to stay local, run fast, and effortlessly handle files that make standard text editors crash
π§ Email: pookielinuxuser@tutamail.com
License: MIT License
Made with β€οΈ in Go π‘οΈ
If JSON Beautify saved you from a headache today, drop a star! β
First Published : !4th December 2025
Last UPdated : 14th December 2025