← Blog/JavaScript

Build 5 Working Web Tools with Pure HTML and JavaScript — No Framework Needed

Learn how to build 5 real web tools from scratch: a calculator with keyboard support, a countdown timer with sound, a to-do list with localStorage, a password generator, and a color picker.

📅 2026-06-262 min read📚 Ebook #10

Why Build Tools Without a Framework?

Frameworks like React and Vue are great for large applications. But for small, self-contained tools, they add unnecessary complexity. A pure HTML + CSS + JavaScript tool:

  • Opens immediately in any browser
  • Has zero dependencies
  • Is a single file you can share anywhere
  • Teaches you the fundamentals that frameworks are built on

Tool 1 — Calculator with Keyboard Support

The tricky part of a calculator is the math logic. We avoid eval() for security reasons and build our own expression handler:

let current = '0';
let expression = '';

function calculate() {
  const fullExpr = expression + current;
  const safe = fullExpr.replace(/[^0-9+\-*/. ]/g, '');
  const result = Function('"use strict"; return (' + safe + ')')();
  current = String(parseFloat(result.toFixed(10)));
}

// Keyboard support
document.addEventListener('keydown', (e) => {
  if (e.key >= '0' && e.key <= '9') inputNum(e.key);
  else if (e.key === 'Enter') calculate();
  else if (e.key === 'Escape') clearCalc();
});

Tool 2 — Password Generator with Crypto

We use crypto.getRandomValues() instead of Math.random() for cryptographically secure passwords:

function generate(length, chars) {
  let password = '';
  const arr = new Uint32Array(length);
  crypto.getRandomValues(arr);
  arr.forEach(v => password += chars[v % chars.length]);
  return password;
}

Tool 3 — To-Do List with localStorage

Tasks persist after closing the browser:

let tasks = JSON.parse(localStorage.getItem('todos') || '[]');

function save() {
  localStorage.setItem('todos', JSON.stringify(tasks));
}

function addTask(text) {
  tasks.unshift({ id: Date.now(), text, done: false });
  save();
  render();
}

Tool 4 — Countdown Timer with Sound Alert

When the timer hits zero, we use the Web Audio API to play a beep without any audio file:

function playBeep() {
  const ctx = new AudioContext();
  const osc  = ctx.createOscillator();
  const gain = ctx.createGain();
  osc.connect(gain);
  gain.connect(ctx.destination);
  osc.frequency.value = 880;
  gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.3);
  osc.start();
  osc.stop(ctx.currentTime + 0.3);
}

This is a preview. The full ebook includes the complete code for all 5 tools — including the SVG circular ring for the timer and the color history swatch grid for the color picker — plus a deployment guide.

Ready to Build This Yourself?

This article is a preview. The full ebook has complete code, detailed explanations, troubleshooting tips, and bonus sections — all in a downloadable PDF.

Buy Full Ebook — $1.50 in $YFIN
Pay with $YFIN on BNB Smart Chain · 30% burned permanently