DEV Community

Bùi Quang
Bùi Quang

Posted on

Building a Zero-Dependency Developer Toolkit with Vanilla JavaScript

Building a Zero-Dependency Developer Toolkit with Vanilla JavaScript

A lightweight, privacy-first collection of 10 essential developer utilities — running entirely in the browser with zero external dependencies.

Live demo: https://devtoolkit.pages.dev


The Problem

As developers, we constantly reach for online tools: format JSON, decode JWTs, test regex, generate passwords, convert colors. But most of these tools come with baggage:

  • Privacy risks: your data hits someone else's server.
  • Ad-heavy UIs: cluttered interfaces that slow you down.
  • Unnecessary dependencies: a simple formatter pulling in 2MB of JavaScript.
  • No offline access: dead when the network flakes.

I wanted something fast, private, and completely offline-capable — so I built DevToolKit.


What I Built

DevToolKit is a single-page application with 10 utilities, each implemented in pure vanilla JavaScript. No React. No Vue. No build step. Just HTML, CSS, and JS served statically from a global CDN.

Feature Set

Tool What It Does
JSON Formatter Pretty-print, minify, and validate JSON with a syntax-aware tree view
Base64 Converter Encode and decode text and files with drag-and-drop support
Regex Tester Live pattern matching against multiline input with capture group highlighting
JWT Decoder Decode header and payload of JSON Web Tokens without verification
Password Generator Cryptographically strong passwords with adjustable length and character sets
Color Converter Convert between HEX, RGB, and HSL, and copy values instantly
HTML Entity Encoder Encode special characters to HTML entities and back
CSS Minifier Strip whitespace and comments from CSS for production
Dummy Text Generator Generate structured filler copy by paragraphs, words, or bytes
Hash Generator Compute SHA-1, SHA-256, and SHA-512 using the Web Crypto API

Why Zero Dependencies?

1. Privacy by Design

Every tool runs client-side. Your JSON, JWTs, passwords, and files never leave your browser. For the hash generator and password generator, we use the native crypto.subtle API — the same API that powers TLS.

2. Speed

The entire application is under 50KB gzipped. First paint happens in under 200ms on a slow mobile connection. No npm install, no bundle step, no dependency audit nightmares.

3. Offline First

Because everything is self-contained, you can save the page and use it without an internet connection. It works in airplane mode.

4. Longevity

Dependencies rot. A single unpublished package broke the internet back in 2016. By relying only on browser APIs that have been stable for years, this tool will still work in 2030.


Technical Highlights

Recursive JSON Tree Rendering

Instead of using a third-party viewer library, I built a recursive DOM generator that walks any JSON structure and creates collapsible tree nodes. It handles deep nesting gracefully and preserves type information for strings, numbers, booleans, and nulls.

function renderTree(value, key) {
  if (value === null) return span('null', 'json-null');
  if (typeof value === 'object') {
    const isArray = Array.isArray(value);
    const container = el('div', 'json-branch');
    const toggle = el('span', 'json-toggle', isArray ? '[' : '{');
    // recursively render children, then attach toggle handler
    return container;
  }
  return span(JSON.stringify(value), 'json-' + typeof value);
}
Enter fullscreen mode Exit fullscreen mode

Web Crypto for Hashing

Modern browsers expose crypto.subtle.digest, which lets us compute SHA-256 and friends without importing a single library:

async function sha256(message) {
  const encoder = new TextEncoder();
  const data = encoder.encode(message);
  const hashBuffer = await crypto.subtle.digest('SHA-256', data);
  return Array.from(new Uint8Array(hashBuffer))
    .map(b => b.toString(16).padStart(2, '0'))
    .join('');
}
Enter fullscreen mode Exit fullscreen mode

Drag-and-Drop File Reading

The Base64 tool supports dragging files directly onto the page, using the FileReader API to convert to Base64 or decode back to binary — all without a server round-trip.


Architecture Decisions

No Framework

For a tool with 10 independent tabs, a framework adds more complexity than value. Vanilla JS with a simple tab-switching router keeps the mental model flat and the bundle tiny.

CSS Variables for Theming

A single :root definition controls the entire color palette. Switching from light to dark mode is a one-line class toggle on the document element.

Static Hosting on a Global CDN

Static hosting with automatic HTTPS and instant cache invalidation. The site deploys in under 30 seconds from a git push, and every visitor gets the nearest edge node.


Try It Out

The live site is here: https://devtoolkit.pages.dev

Bookmark it, or save the page locally and keep it in your toolbar for offline use.


Who Is This For?

  • Developers who want offline tools without installing desktop apps.
  • Security-conscious teams who cannot paste proprietary data into third-party websites.
  • Students learning JavaScript who want to read production-quality vanilla code.
  • Minimalists who believe software should do one thing and do it well.

Final Thoughts

Sometimes the best dependency is no dependency. Modern browsers are incredibly capable. Before reaching for a package manager, ask yourself: can the platform already do this?

DevToolKit is my answer to that question — a reminder that 50KB of focused code can replace 5MB of imported abstraction.

Happy coding.

Top comments (0)