<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muzammil Zia Tarar</title>
    <description>The latest articles on DEV Community by Muzammil Zia Tarar (@muzammilziatarar).</description>
    <link>https://dev.to/muzammilziatarar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4278276%2F400679df-456e-435b-abf9-a9760cb71765.png</url>
      <title>DEV Community: Muzammil Zia Tarar</title>
      <link>https://dev.to/muzammilziatarar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muzammilziatarar"/>
    <language>en</language>
    <item>
      <title>I built 237 free tools that never upload your files. Here's what running everything in the browser taught me</title>
      <dc:creator>Muzammil Zia Tarar</dc:creator>
      <pubDate>Wed, 02 Dec 2026 10:48:37 +0000</pubDate>
      <link>https://dev.to/muzammilziatarar/i-built-237-free-tools-that-never-upload-your-files-heres-what-running-everything-in-the-browser-el2</link>
      <guid>https://dev.to/muzammilziatarar/i-built-237-free-tools-that-never-upload-your-files-heres-what-running-everything-in-the-browser-el2</guid>
      <description>&lt;p&gt;Most "free online PDF" sites work the same way: you upload your file, their server processes it, and you download the result. That's fine for a recipe card. It's less fine for an ID card or passport scan, a bank statement, or a signed contract, which is exactly what people put through these tools.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://toolnama.com" rel="noopener noreferrer"&gt;ToolNama&lt;/a&gt;: 237 free tools (PDF, image, video, text, tax and everyday calculators) where the file never leaves the device. There is no upload endpoint for files. The whole site is static HTML served from shared hosting, and the tools do their work in the visitor's browser. (One honest exception: Speech to Text uses the browser's built-in speech service, which in Chrome means Google processes the audio. The tool page says so.)&lt;/p&gt;

&lt;p&gt;This post covers how that works, what was harder than expected, and a few bugs I only found by testing on small phones.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack: no framework, one build script
&lt;/h2&gt;

&lt;p&gt;Each tool is a single HTML fragment with one &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;. A Python build script wraps them in a page template, inlines the shared helpers, writes 925 pages (237 tools plus translations into 21 languages), a sitemap and a search index, and zips the result for upload. No bundler, no framework, no runtime server code apart from a tiny &lt;code&gt;ip.php&lt;/code&gt; for the "What is my IP" tool.&lt;/p&gt;

&lt;p&gt;Heavy libraries load only when a tool needs them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Job&lt;/th&gt;
&lt;th&gt;Library&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Read and render PDFs&lt;/td&gt;
&lt;td&gt;pdf.js&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit, merge, split, password-protect PDFs&lt;/td&gt;
&lt;td&gt;pdf-lib (a fork with AES-256 encryption for Protect PDF)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Video and audio&lt;/td&gt;
&lt;td&gt;ffmpeg.wasm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OCR&lt;/td&gt;
&lt;td&gt;Tesseract (WebAssembly)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI upscaling, face restore, background removal&lt;/td&gt;
&lt;td&gt;ONNX Runtime Web with WebGPU, falling back to WebAssembly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;iPhone HEIC photos&lt;/td&gt;
&lt;td&gt;libheif compiled to WebAssembly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Word to PDF&lt;/td&gt;
&lt;td&gt;docx-preview + html2canvas&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Lesson 1: big files will crash the tab unless you stop copying them
&lt;/h2&gt;

&lt;p&gt;The first version of the video tools read the whole file into memory and wrote it into ffmpeg's virtual file system. A 1.5 GB phone video means 1.5 GB in JavaScript plus another 1.5 GB inside the WebAssembly heap, and mobile browsers kill the tab long before that.&lt;/p&gt;

&lt;p&gt;ffmpeg.wasm can mount files instead of copying them, using Emscripten's &lt;code&gt;WORKERFS&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'/m'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ffmpeg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createDir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ffmpeg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'WORKERFS'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ffmpeg now reads straight from the File object, in chunks&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ffmpeg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'-i'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`${dir}/${name}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If mounting fails (older builds), the code falls back to &lt;code&gt;writeFile&lt;/code&gt;. Either way the temporary files are deleted in a &lt;code&gt;finally&lt;/code&gt; block, because a leaked 500 MB file inside the WebAssembly heap stays there until the tab closes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 2: on-device AI is possible, but tiles and seams are the real work
&lt;/h2&gt;

&lt;p&gt;The image upscaler and face restorer run Real-ESRGAN and GFPGAN as ONNX models in the browser. The model files are big (the int8 face restorer is about 85 MB, the background remover about 44 MB), so they load only when the tool is opened, and the file name changes whenever a model is replaced, so the browser cache never serves a stale one.&lt;/p&gt;

&lt;p&gt;Two things mattered more than the model choice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pick the model by hardware.&lt;/strong&gt; Strong GPUs (via WebGPU) get the larger Real-ESRGAN x4plus model. Everything else gets a compact model on WebGPU, or on one WebAssembly worker per CPU core when WebGPU isn't available.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upscale in tiles, and blend the tile edges.&lt;/strong&gt; A 12-megapixel photo won't fit through the model in one pass on a phone. Naive tiling leaves visible seams. Overlapping the tiles and blending them with linear ramps (each tile fades in and out across the overlap) removed the seams, and the output matches a whole-image pass to within one colour level.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Lesson 3: a strict security policy works fine on a static site
&lt;/h2&gt;

&lt;p&gt;Running untrusted files through JavaScript means a cross-site scripting bug would hurt. Every page carries a Content Security Policy with hashes instead of &lt;code&gt;'unsafe-inline'&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;csp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;scripts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;script(?: type="speculationrules")?&amp;gt;(.*?)&amp;lt;/script&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;S&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;hashes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"'sha256-%s'"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;scripts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"script-src {hashes} 'strict-dynamic'; object-src 'none'; base-uri 'none'; form-action 'self'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because every script is inlined at build time, the build can hash all of them, and &lt;code&gt;'strict-dynamic'&lt;/code&gt; lets those trusted scripts load the big libraries (and the ad script) on demand. The build also refuses to finish if any page has an inline &lt;code&gt;on...=&lt;/code&gt; handler, an external &lt;code&gt;&amp;lt;script src&amp;gt;&lt;/code&gt;, or a CSP without &lt;code&gt;strict-dynamic&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One gotcha: the build output must keep byte-identical line endings. On Windows, a stray CRLF conversion changes every script's hash and silently breaks every page.&lt;/p&gt;

&lt;p&gt;The other half is boring discipline: anything a user typed, any file name and any URL parameter goes through &lt;code&gt;textContent&lt;/code&gt; or an escaping helper, never straight into &lt;code&gt;innerHTML&lt;/code&gt;. I ran every tool with the classic payloads (an &lt;code&gt;&amp;lt;img onerror&amp;gt;&lt;/code&gt;, an &lt;code&gt;&amp;lt;svg onload&amp;gt;&lt;/code&gt;, a quote that tries to escape an attribute) typed into text boxes and used as file names. Nothing executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 4: mobile bugs hide in CSS you wrote last week
&lt;/h2&gt;

&lt;p&gt;Most visitors arrive on phones, so I wrote a Playwright script that opens all 346 English, Spanish, Arabic and Urdu pages at 320, 360, 390, 412, 768 and 1024 px. It checks three things: the page is wider than the screen, an element sticks out of the tool card, or two form controls overlap. It runs twice: once on the empty page, and once after loading a sample image, PDF or Word file and pressing the main button.&lt;/p&gt;

&lt;p&gt;It found bugs I would never have spotted by hand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A class name collision.&lt;/strong&gt; The PDF editor positions draggable items with &lt;code&gt;.it { position: absolute }&lt;/code&gt;. The invoice generator, written a few days earlier, also used &lt;code&gt;.it&lt;/code&gt; for its line items. Every invoice row was absolutely positioned on top of the next field. Scoping the rule to &lt;code&gt;.pgw .it&lt;/code&gt; fixed it on every screen size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;minmax(280px, 1fr)&lt;/code&gt; on a 320 px phone.&lt;/strong&gt; Inside a card with padding, there are only about 240 px to work with, so a "responsive" two-column grid overflowed on 14 tools. &lt;code&gt;minmax(min(280px, 100%), 1fr)&lt;/code&gt; fixed all of them with one change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iPhone zoom on focus.&lt;/strong&gt; Safari zooms the page when you tap any input with text smaller than 16 px. A global &lt;code&gt;font-size: max(16px, 1em)&lt;/code&gt; on touch devices fixed 31 tools at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On narrow screens the top category bar became a hamburger menu that opens the same mega-menu panels, shown as an accordion, so there's one source for both layouts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lesson 5: say what you can't verify
&lt;/h2&gt;

&lt;p&gt;Some tools touch rules that people rely on, like tax slabs or converting a CGPA to a percentage. Each tax tool stores the date its rates expire; after that date the page shows a warning, and a cron job emails me to check the new official figures. The CGPA converter works on any scale and adds the formulas universities actually publish (CBSE and AICTE in India, Bangladesh's UGC scale, the Philippines, Nigeria, Pakistan's HEC table, plus Germany's grade formula). Where sources disagree, it shows the alternatives and says so, rather than pretending one formula is the official answer everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Was it worth it?
&lt;/h2&gt;

&lt;p&gt;Running everything client-side costs more engineering, not less: memory limits, slow phones, big model downloads and no server to fall back on. In return, hosting stays cheap, the privacy claim is simple to check (open DevTools and watch the network tab while you use a tool), and there's no queue of user files sitting on a server somewhere.&lt;/p&gt;

&lt;p&gt;If you're building something similar, my advice is: mount big files instead of copying them, tile and blend anything that runs a model on images, hash your inline scripts at build time, and automate your mobile layout checks.&lt;/p&gt;

&lt;p&gt;The tools are at &lt;a href="https://toolnama.com" rel="noopener noreferrer"&gt;toolnama.com&lt;/a&gt;. I'd love to hear what breaks on your device.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: ToolNama was built with an AI coding assistant, and this post was drafted by AI from the project's code and build notes. The code, numbers and bugs above are real and come from building and testing the site.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webassembly</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
