Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JSON
  3. JSONC

JSONC

MITJavaScript

A JavaScript library that compresses JSON data using key mapping and GZIP to reduce payload size for web applications.

GitHubGitHub
651 stars86 forks0 contributors

What is JSONC?

JSONC is a JavaScript library that compresses JSON data to reduce payload size during client-server communication in web applications. It solves bandwidth and performance issues by offering two methods: key mapping for structural compression and GZIP integration for binary compression. This is especially useful when GZIP isn't available for data sent from browsers to servers.

Target Audience

Frontend and full-stack developers building rich internet applications (RIAs) that transmit large JSON payloads, particularly those concerned with network efficiency and load times.

Value Proposition

Developers choose JSONC for its dual compression approach, which can reduce JSON size by up to 32.81% with key mapping and over 75% with GZIP, outperforming standard compression in client-to-server scenarios. It's lightweight, easy to integrate, and addresses a specific gap in web optimization.

Overview

JSON compressor and decompressor

Use Cases

Best For

  • Reducing JSON payload size in AJAX or fetch requests from browser to server
  • Optimizing data transfer for real-time web applications with frequent updates
  • Improving load times for applications transmitting large JSON datasets
  • Compressing JSON API responses when GZIP isn't supported on the client side
  • Minimizing bandwidth usage in mobile or low-connectivity web apps
  • Pre-processing JSON data before storage or further compression

Not Ideal For

  • Applications transmitting very small JSON objects where key mapping could bloat payload size
  • Environments where GZIP compression is already consistently applied in both client-server directions
  • Real-time systems sensitive to the latency added by compression and decompression steps

Pros & Cons

Pros

Dual Compression Flexibility

Combines key mapping for structural efficiency and GZIP for binary compression, allowing tailored approaches based on data type, as shown in compression rates from 7.5% to over 75% in the examples.

Targeted Bandwidth Reduction

Specifically optimizes browser-to-server data flow where GZIP is often unavailable, directly addressing a performance bottleneck in rich internet applications, as stated in the README's background.

Impressive Size Savings

Can reduce JSON payloads by up to 32.81% with key mapping alone and over 75% with combined methods, demonstrated in the data2.js example with a 75.49% compression rate.

Straightforward API

Offers simple methods like compress() and pack() for compression, and decompress() and unpack() for reversal, making integration easy with minimal code changes, as outlined in the Usage section.

Cons

Variable Compression Efficiency

Key mapping can increase size for small JSON objects, requiring careful evaluation to avoid negative impacts, as explicitly warned in the README under the compress method description.

Limited Server-Side Support

Server-side implementations in languages like Java or Ruby are listed as 'next steps,' meaning current support is JavaScript-centric, which can hinder adoption in mixed-technology stacks.

Base64 Encoding Overhead

The GZIP method uses Base64 encoding, which inflates compressed data by about 33%, potentially offsetting compression gains for already small payloads and adding processing complexity.

Frequently Asked Questions

Quick Stats

Stars651
Forks86
Contributors0
Open Issues20
Last commit7 years ago
CreatedSince 2013

Tags

#web-performance#javascript-library

Built With

b
base64
J
JavaScript
G
Gzip

Included in

JSON1.5k
Auto-fetched 1 day ago

Related Projects

normalizrnormalizr

Normalizes nested JSON according to a schema

Stars20,844
Forks863
Last commit4 years ago
fast-xml-parserfast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.

Stars3,083
Forks370
Last commit1 day ago
x2jsx2js

x2js - XML to JSON and back for JavaScript

Stars1,006
Forks476
Last commit4 years ago
osmtogeojsonosmtogeojson

convert osm to geojson

Stars743
Forks121
Last commit13 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub