Articles
How the tools on this site work, from the file formats to the algorithms, with the real code.
How I Built a QR Code Encoder From the Standard, With No Library
Bits, Reed–Solomon error correction, interleaving, zigzag placement and masks, step by step, with the TypeScript behind ToolOnTap's QR code generator.
Reading an iPhone HEIC Photo's Hidden Location by Hand
How a HEIC file is built from boxes, how to find its Exif item through iinf and iloc, and how ToolOnTap's EXIF viewer reads it in about 75 lines.
How My Regex Tester Survives Catastrophic Backtracking
Why one bad regular expression can freeze a browser tab for minutes, and how ToolOnTap's regex tester runs patterns in a worker it can stop after 1.5 seconds.
Why My JSON Formatter Has Its Own Parser Instead of JSON.parse
Big numbers that JSON.parse rounds, errors with a line and column, and duplicate keys: how ToolOnTap's JSON formatter parses JSON itself in about 200 lines.
Counting Arabic Words and Characters Correctly in JavaScript
Why "مَرْحَبًا".length is 9, how ToolOnTap's word counter counts harakat, tatweel, emoji and links, and how SMS and X limits really work for Arabic text.
How to Get an Image Under an Exact KB Limit, and When You Can't
What "20 KB" means to a form, how ToolOnTap lowers quality and then pixel size to reach it, why PNG behaves differently, and what happens when it can't.
Verifying JWT Signatures in the Browser With Web Crypto
Why decoding a JWT proves nothing, and how ToolOnTap's JWT decoder checks HS, RS, PS and ES signatures with the browser's own crypto, keys and all.
Exact Age Is Harder Than It Looks, in Gregorian and Hijri Years
Month ends, 29 February birthdays and Hijri years of 354 or 355 days, with the TypeScript rules behind ToolOnTap's age calculator.
Converting iPhone HEIC Photos to JPG Inside the Browser
Why HEIC photos get stuck on Windows and upload forms, and how ToolOnTap turns them into JPGs on your device without loading 1.3 MB of decoder on every page.
How GPA Is Calculated, on the 4.0 and the Saudi 5.0 Scale
Credit-weighted averages, term versus cumulative GPA, why averaging your term GPAs gives the wrong answer, and how a failed course counts on each scale.
UUID v4 vs v7, and Why Time-Ordered IDs Make Better Database Keys
What sits in each of a UUID's 128 bits, how v7 puts a millisecond timestamp first, and how ToolOnTap's generator keeps a batch in order within one millisecond.
How I Remove EXIF Data From Photos Without Re-Compressing Them
Cutting metadata out of JPEG segments, PNG chunks and WebP chunks byte by byte, and why ToolOnTap's Remove EXIF tool keeps the orientation and color profile.
MD5 and SHA Hashes in the Browser, and Why I Wrote MD5 by Hand
Web Crypto has SHA but no MD5. How ToolOnTap's hash generator implements RFC 1321 itself, checks downloads against a checksum, and where MD5 still belongs.
How Merging PDFs Works in the Browser, and What Gets Lost
How ToolOnTap merges PDFs with pdf-lib's copyPages, previews them with pdf.js, refuses protected files, and why bookmarks and form fields don't survive.
Base64 and URL Encoding Explained, and Why btoa() Fails on Arabic
What Base64, Base64URL and percent-encoding really do to your bytes, why btoa() breaks on Arabic and accents, and when a + means a space.
Why Photos Show Up Sideways, and How EXIF Orientation Works
The eight EXIF orientation values, why a photo that looks fine on your phone turns sideways online, and how ToolOnTap rotates and flips images on a canvas.
How Split PDF Reads "1-3, 5, 8-" and Turns It Into Files
The page-range parser, the four split modes, the file names and the ZIP behind ToolOnTap's Split PDF, with the TypeScript that runs in your browser.
From Millimeters to Pixels: How a Passport Photo Sheet Is Laid Out
Turning official passport sizes into pixels at 300 DPI, fitting the most copies on a 4×6 print, and why ToolOnTap only publishes sizes it has checked.
Turning PDF Pages Into JPG and PNG in the Browser With pdf.js
What 72, 150 and 300 DPI mean in pixels, why scanned pages can come out blank, and how ToolOnTap ships pdf.js with one shared worker.
PNG, JPG and WebP Conversions, and the Browser Quirks Behind Them
Why transparency turns white in a JPG, why JPG to PNG makes files bigger, and why Safari quietly hands back a PNG when you ask it for a WebP.
Six Percentage Questions and the Formula Behind Each One
Percent of, what percent, change, the whole from a part, adding VAT and taking it back out, plus how the calculator reads 1,250, 12,5 and Arabic digits.
One Small Edit Model Behind Rotate, Delete and Rearrange PDF Pages
How ToolOnTap's PDF organizer stores each change as plain data, keeps 50 steps of undo, and saves rotation as a page setting instead of redrawing the page.
Resizing Images Without Blur or Stretching, Inside the Browser
Pixels or percentage, fitting inside a box, the 16.7-megapixel canvas cap and how the browser resamples, with the TypeScript behind ToolOnTap's image resizer.
What Do I Need on My Final? Deriving the Formula Step by Step
The one-line equation behind every final grade calculator, solved for the final score, with what a result above 100% or below 0% really means.
Putting Photos Into a PDF Without Re-Compressing Them
How ToolOnTap's Image to PDF tool sizes pages in points, turns pages for wide scans, keeps JPGs untouched with pdf-lib, and fixes sideways phone photos.
The Rules Behind Title Case, Sentence Case and camelCase
How ToolOnTap's case converter decides which words get capitals, keeps iPhone and NASA intact, rescues caps-lock text and splits XMLHttpRequest for code.
Why a Circle Crop Is Really a Square: Building an Image Cropper
How ToolOnTap's crop tool does free, square and circle crops with cropperjs and a canvas, and why every round avatar is saved as a square PNG.
Why Two Identical Lines Aren't Always Duplicates, and How I Fixed It
Unicode normalization, invisible spaces, keep first or last, and natural sorting, explained through the code behind ToolOnTap's remove duplicate lines tool.
Instagram, YouTube and LinkedIn Image Sizes, Checked at the Source
The output sizes behind ToolOnTap's Instagram, YouTube and LinkedIn resizers, why they crop to fill instead of fitting, and how the file size warning works.
Images as Base64 Data URIs, and When Inlining Helps or Hurts
Why Base64 makes an image a third bigger, when a data URI saves a request and when it slows a page down, and how ToolOnTap's Image to Base64 tool is built.