<?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: Toolenix</title>
    <description>The latest articles on DEV Community by Toolenix (@toolenix).</description>
    <link>https://dev.to/toolenix</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%2F4184899%2F94214fa3-2d0b-4850-bd23-756229bd32d6.png</url>
      <title>DEV Community: Toolenix</title>
      <link>https://dev.to/toolenix</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/toolenix"/>
    <language>en</language>
    <item>
      <title>Decoding JWTs in the Browser: Read Your Token Without Sending It Anywhere</title>
      <dc:creator>Toolenix</dc:creator>
      <pubDate>Thu, 26 Nov 2026 15:13:57 +0000</pubDate>
      <link>https://dev.to/toolenix/decoding-jwts-in-the-browser-read-your-token-without-sending-it-anywhere-oic</link>
      <guid>https://dev.to/toolenix/decoding-jwts-in-the-browser-read-your-token-without-sending-it-anywhere-oic</guid>
      <description>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Every online JWT decoder asks you to paste in a live access token. Mine decodes it in your browser with 15 lines of JavaScript — here is the code, and the one thing decoding can never tell you.&lt;/p&gt;




&lt;p&gt;You know the moment: your API returns a 401, you suspect the token expired, and you need to see what is inside it. So you open an online JWT decoder, paste in a live access token — a token that authenticates as you — and read the result. It works in seconds. But stop and think about what just happened: you handed a working credential to a server you do not control.&lt;/p&gt;

&lt;p&gt;I built the JWT Decoder on &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;Toolenix&lt;/a&gt; so that never happens. It decodes the header and payload of a token entirely in your browser. Nothing is uploaded, nothing is stored. Here is how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea: a JWT is just two chunks of Base64
&lt;/h2&gt;

&lt;p&gt;A JSON Web Token looks like three blocks of gibberish separated by dots — &lt;code&gt;header.payload.signature&lt;/code&gt;. The first two blocks are not encrypted. They are Base64URL-encoded JSON, which means decoding them is just a character swap and a built-in browser function away:&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;function&lt;/span&gt; &lt;span class="nf"&gt;base64UrlDecode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/-/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&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;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;padded&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;padEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&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;return&lt;/span&gt; &lt;span class="nf"&gt;atob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;padded&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decodeJWT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&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;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base64UrlDecode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&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;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;base64UrlDecode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&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="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;Base64URL is Base64 with two characters swapped (&lt;code&gt;-&lt;/code&gt; instead of &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt; instead of &lt;code&gt;/&lt;/code&gt;) and the &lt;code&gt;=&lt;/code&gt; padding stripped, so it survives safely inside a URL. The function above reverses those two swaps, restores the padding, and lets &lt;code&gt;atob()&lt;/code&gt; — built into every browser — do the decoding. &lt;code&gt;split(".")&lt;/code&gt; takes the first two parts; the signature is deliberately ignored, because decoding never needs it. Try it in your console with the standard example token:&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;decodeJWT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// { header: { alg: "HS256", typ: "JWT" },&lt;/span&gt;
&lt;span class="c1"&gt;//   payload: { sub: "1234567890", name: "John Doe", iat: 1516239022 } }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;iat&lt;/code&gt; value, 1516239022, is a Unix timestamp — 18 January 2018. Every time-based claim in a JWT is a number like this: seconds since 1 January 1970.&lt;/p&gt;

&lt;h2&gt;
  
  
  The check that actually solves the 401: has it expired?
&lt;/h2&gt;

&lt;p&gt;Nine times out of ten, you are decoding a token for one reason — to find out whether it is dead. The &lt;code&gt;exp&lt;/code&gt; claim answers that in one comparison:&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;function&lt;/span&gt; &lt;span class="nf"&gt;isExpired&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&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;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiply by 1,000 because JavaScript dates work in milliseconds while JWT timestamps are in seconds — the single easiest bug to write in this whole area, and the one that makes a live token look expired or a dead one look fine. If &lt;code&gt;exp&lt;/code&gt; is in the past, the token is dead, whatever else it says. That one line is the difference between guessing at a 401 and knowing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The details that make it feel like a real tool
&lt;/h2&gt;

&lt;p&gt;Decoding itself is a few lines. The behaviour around it is what makes people come back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expiry in plain language&lt;/strong&gt; — the raw timestamp is shown next to a readable date and a live-or-expired verdict, because nobody wants to convert epoch seconds in their head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every claim, readable&lt;/strong&gt; — the full header and payload as formatted JSON, so &lt;code&gt;iss&lt;/code&gt;, &lt;code&gt;aud&lt;/code&gt;, and &lt;code&gt;sub&lt;/code&gt; are all visible at a glance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copy in one click&lt;/strong&gt; — &lt;code&gt;navigator.clipboard.writeText()&lt;/code&gt; on the decoded JSON, because nobody wants to select a nested object by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant feedback&lt;/strong&gt; — decoding runs as you paste, so the claims appear before you finish reaching for the mouse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Private by construction&lt;/strong&gt; — there is no server endpoint to call. The page is static; the work happens in your browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;p&gt;Decoding is not verifying, and that distinction is the whole security model of JWTs. Decoding reads the claims; it does not check the signature and it does not prove the token is genuine. Anyone can create a token with any claims they like and sign it with a key nobody trusts — the decoded payload will look perfectly plausible. Never trust decoded claims until your server has verified the signature against the issuer's key. And never put a secret in a payload: the payload is readable by design, so anything inside it is public to whoever holds the token.&lt;/p&gt;

&lt;p&gt;Two more limits worth knowing. If the header says &lt;code&gt;"alg": "none"&lt;/code&gt;, the token is unsigned and must never be trusted. And not every token has a readable payload at all: a JWE token (JSON Web Encryption) has five parts instead of three, and its payload is encrypted — it cannot be decoded without the decryption key. If you paste a five-part token and get nothing readable, that is expected. The token is doing its job.&lt;/p&gt;

&lt;p&gt;One small technical note: plain &lt;code&gt;atob()&lt;/code&gt; handles ASCII payloads fine, but a name with non-ASCII characters needs a UTF-8-safe decode — the &lt;code&gt;decodeURIComponent&lt;/code&gt; wrapper the live tool uses — or the characters come back garbled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why client-side wins for tools like this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; an access token is a live credential. Decoding it in your browser means it never travels anywhere it could be logged, replayed, or stolen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; no upload, no queue, no round-trip. &lt;code&gt;atob&lt;/code&gt; on a token takes microseconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; static hosting. No server to scale, no bandwidth bill for other people's tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability:&lt;/strong&gt; nothing to go down. If the page loads, the tool works — even offline after the first load.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The decoder is live at &lt;a href="https://toolenix.com/tools/jwt-decoder" rel="noopener noreferrer"&gt;toolenix.com/tools/jwt-decoder&lt;/a&gt; — free, no sign-up, and your tokens never leave your browser. The whole site is built on the same idea: 113 tools, all client-side.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>jwt</category>
      <category>security</category>
    </item>
    <item>
      <title>Hashing in the Browser: SHA-256 Without a Server</title>
      <dc:creator>Toolenix</dc:creator>
      <pubDate>Thu, 19 Nov 2026 15:13:11 +0000</pubDate>
      <link>https://dev.to/toolenix/hashing-in-the-browser-sha-256-without-a-server-29bh</link>
      <guid>https://dev.to/toolenix/hashing-in-the-browser-sha-256-without-a-server-29bh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Every checksum tool you have used uploads your file first. Mine hashes it in your browser with one built-in API — here is the 15 lines of JavaScript that do it.&lt;/p&gt;




&lt;p&gt;You have done this before: download a file, open a checksum tool, upload the file, wait for the hash, and compare it against the one on the download page. It works — but the file you just uploaded might be a private document, a backup, or a build artefact you would rather not hand to a stranger's server.&lt;/p&gt;

&lt;p&gt;I built the Hash Generator on &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;Toolenix&lt;/a&gt; so that never happens. It computes SHA-256, SHA-512, and SHA-1 entirely in your browser, using an API that is already built into every modern browser. Nothing is uploaded, nothing is stored. Here is how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea: the browser already has a crypto engine
&lt;/h2&gt;

&lt;p&gt;You do not need a library for hashing. The Web Crypto API ships in every modern browser, and its &lt;code&gt;crypto.subtle.digest()&lt;/code&gt; method does the whole job in one call. It takes an algorithm name and some bytes, and returns the hash:&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sha256Hex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&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;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&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="s2"&gt;"SHA-256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hash&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;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&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;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the entire engine. &lt;code&gt;TextEncoder&lt;/code&gt; turns your string into bytes, &lt;code&gt;digest()&lt;/code&gt; hashes them, and the last three lines convert the raw bytes into the hex string you recognise. Try it in your browser console:&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;sha256Hex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SHA-256 always produces 256 bits, which is 64 hex characters — no matter whether the input is five letters or five megabytes. SHA-512 gives 128 hex characters, and SHA-1 gives 40. Same input, same hash, every time. That determinism is the whole point: if two files produce the same hash, they are the same file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part people actually need: hashing a file
&lt;/h2&gt;

&lt;p&gt;Hashing a short string is a demo. The real use is verifying a download, and files are just bytes too — &lt;code&gt;File&lt;/code&gt; objects have an &lt;code&gt;arrayBuffer()&lt;/code&gt; method that hands those bytes straight to &lt;code&gt;digest()&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sha256File&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&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="s2"&gt;"SHA-256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hash&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;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"0"&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;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pick a file with an &lt;code&gt;&amp;lt;input type="file"&amp;gt;&lt;/code&gt;, run this, and compare the result with the checksum the publisher printed. If they match, the download is intact. If they do not, something changed in transit — and you found out before running the file, without uploading it anywhere. Change one byte of the input and the hash changes completely; that avalanche effect is what makes a hash a fingerprint rather than a summary.&lt;/p&gt;

&lt;h2&gt;
  
  
  The details that make it feel like a real tool
&lt;/h2&gt;

&lt;p&gt;The hashing itself is a few lines. The behaviour around it is what makes people come back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Three algorithms at once&lt;/strong&gt; — SHA-256, SHA-512, and SHA-1 computed from the same input, side by side, because different publishers print different checksums.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copy in one click&lt;/strong&gt; — &lt;code&gt;navigator.clipboard.writeText()&lt;/code&gt; on each result, because nobody wants to select 64 hex characters by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant feedback&lt;/strong&gt; — hashing runs as you type for text, so the fingerprint updates live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Private by construction&lt;/strong&gt; — there is no server endpoint to call. The page is static; the work happens in your browser's own crypto engine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;crypto.subtle&lt;/code&gt; only works in secure contexts — HTTPS or localhost — so a plain HTTP page cannot use it at all. That is a good restriction, not a bug: crypto that runs over an insecure connection is not trustworthy. And SHA-1 is in the tool for legacy checksums only. It was practically broken in 2017, when Google demonstrated the first real collision, so never use it to verify anything that matters — SHA-256 is the default for a reason.&lt;/p&gt;

&lt;p&gt;One more limit worth knowing: hashing a very large file loads the whole thing into memory at once with &lt;code&gt;arrayBuffer()&lt;/code&gt;. For a free web tool that is fine for the files people actually verify, but a desktop tool would stream the file in chunks instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why client-side wins for tools like this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; the file you are verifying never leaves your device. For a checksum tool, that is the feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; no upload, no queue, no round-trip. The browser's crypto engine is hardware-accelerated, so even large files hash in seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; static hosting. No server to scale, no bandwidth bill for other people's files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability:&lt;/strong&gt; nothing to go down. If the page loads, the tool works — even offline after the first load.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The generator is live at &lt;a href="https://toolenix.com/tools/hash-generator" rel="noopener noreferrer"&gt;toolenix.com/tools/hash-generator&lt;/a&gt; — free, no sign-up, and your files never leave your browser. The whole site is built on the same idea: 113 tools, all client-side.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building a JSON Formatter That Never Sees Your Data</title>
      <dc:creator>Toolenix</dc:creator>
      <pubDate>Thu, 12 Nov 2026 15:11:16 +0000</pubDate>
      <link>https://dev.to/toolenix/building-a-json-formatter-that-never-sees-your-data-27j5</link>
      <guid>https://dev.to/toolenix/building-a-json-formatter-that-never-sees-your-data-27j5</guid>
      <description>&lt;p&gt;Paste an API response into most formatters and it travels to a server first. Mine formats it in your browser — here is the 20 lines of JavaScript that do it.&lt;/p&gt;

&lt;p&gt;Every developer has done it: copy a minified API response, paste it into an online JSON formatter, and read the result. It works in seconds. But stop and think about what just happened — your payload travelled to a server you do not control, got processed there, and came back. If that payload held an API key, a user record, or a production config, you just handed it to a stranger.&lt;/p&gt;

&lt;p&gt;I built the JSON Formatter on Toolenix (&lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;https://toolenix.com&lt;/a&gt;) so that never happens. It formats, validates, and minifies JSON entirely in your browser. Nothing is uploaded, nothing is stored. Here is how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea: two built-in functions do everything
&lt;/h2&gt;

&lt;p&gt;JavaScript already ships with everything a JSON formatter needs. &lt;code&gt;JSON.parse()&lt;/code&gt; turns text into a value and throws a helpful error when the text is invalid. &lt;code&gt;JSON.stringify()&lt;/code&gt; turns the value back into text — and its third argument controls the indentation. That is the whole engine:&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;function&lt;/span&gt; &lt;span class="nf"&gt;formatJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spaces&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spaces&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;minifyJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&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;&lt;code&gt;JSON.stringify(value, null, 2)&lt;/code&gt; gives you two-space indentation; pass &lt;code&gt;4&lt;/code&gt; for four spaces. Pass nothing at all and you get a single-line minified string. Two functions, two lines each — that is the formatter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part people actually need: useful errors
&lt;/h2&gt;

&lt;p&gt;Formatting valid JSON is the easy half. The half that saves real time is telling the developer &lt;em&gt;where&lt;/em&gt; their JSON is broken. &lt;code&gt;JSON.parse()&lt;/code&gt; throws a &lt;code&gt;SyntaxError&lt;/code&gt;, and its message already names the problem:&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;function&lt;/span&gt; &lt;span class="nf"&gt;tryFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spaces&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;formatJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;spaces&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="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Invalid JSON: ${err.message}`&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feed it &lt;code&gt;{"name": "Ada",}&lt;/code&gt; and V8 answers with something like &lt;code&gt;Expected double-quoted property name in JSON at position 15&lt;/code&gt;. That position number points straight at the trailing comma. Chrome, Firefox, and Safari all report a position in the message, so the formatter can surface it directly instead of a generic "invalid JSON". In the Toolenix formatter, that message lands in a status banner above the output — the user sees the exact spot to fix, not a dead end.&lt;/p&gt;

&lt;h2&gt;
  
  
  The details that make it feel like a real tool
&lt;/h2&gt;

&lt;p&gt;The formatter itself is a few lines. The behaviour around it is what makes people come back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Two indent choices&lt;/strong&gt; — a toggle between 2 and 4 spaces, because every team has an opinion and both should work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate without reformatting&lt;/strong&gt; — a check that only reports valid or invalid, for when you do not want your input rewritten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Copy in one click&lt;/strong&gt; — &lt;code&gt;navigator.clipboard.writeText()&lt;/code&gt; on the output, because nobody wants to select 400 lines by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large payloads&lt;/strong&gt; — parsing happens in browser memory, so multi-megabyte responses format in well under a second with no upload wait at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dark mode that follows the page&lt;/strong&gt; — small thing, but developers notice when a tool respects it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why client-side wins for tools like this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; an API response with tokens or personal data never leaves the device. For a developer tool, that is the feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; no upload, no queue, no round-trip. &lt;code&gt;JSON.parse&lt;/code&gt; on a typical response takes milliseconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; static hosting. No server to scale, no bandwidth bill for other people's payloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability:&lt;/strong&gt; nothing to go down. If the page loads, the tool works — even offline after the first load.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The limits (honestly)
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JSON.parse&lt;/code&gt; is strict, and that is both its strength and its limit. It rejects trailing commas, single quotes, and comments — all things developers paste in from config files and logs. The formatter reports those as errors rather than guessing what you meant, which is the right call for a validator but means it will not silently "fix" sloppy JSON for you. Very large files can also spike memory, since the whole document is parsed at once. For a free web tool, though, it is more than good enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The formatter is live at &lt;a href="https://toolenix.com/tools/json-formatter" rel="noopener noreferrer"&gt;https://toolenix.com/tools/json-formatter&lt;/a&gt; — free, no sign-up, and your JSON never leaves your browser. The whole site is built on the same idea: 113 tools, all client-side.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>json</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building a Client-Side Image Compressor: No Server, No Upload, Just JavaScript</title>
      <dc:creator>Toolenix</dc:creator>
      <pubDate>Fri, 06 Nov 2026 22:34:35 +0000</pubDate>
      <link>https://dev.to/toolenix/building-a-client-side-image-compressor-no-server-no-upload-just-javascript-281</link>
      <guid>https://dev.to/toolenix/building-a-client-side-image-compressor-no-server-no-upload-just-javascript-281</guid>
      <description>&lt;p&gt;My most-used tool shrinks images without sending a single byte anywhere. Here's the 30 lines of JavaScript that do it.&lt;/p&gt;




&lt;p&gt;Every image compressor you've used uploads your photo to a server, compresses it there, and sends it back. That works — but it means your photos leave your device.&lt;/p&gt;

&lt;p&gt;I built the Image Compressor on &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;Toolenix&lt;/a&gt; to do the whole job in the browser. No upload, no server, no waiting on a network. Here's how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea: canvas does the work
&lt;/h2&gt;

&lt;p&gt;The browser's &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; element can decode an image, redraw it at a smaller size, and export it as a compressed JPEG — all locally. That's the entire trick. Three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the file into an &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; with &lt;code&gt;URL.createObjectURL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Draw it onto a canvas at the target dimensions.&lt;/li&gt;
&lt;li&gt;Export with &lt;code&gt;canvas.toBlob()&lt;/code&gt; at a quality setting you choose.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;

&lt;p&gt;Here's the heart of it — a function that takes a file and a target width, and returns a compressed blob:&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="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;compressImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1920&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quality&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;loadImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Keep the aspect ratio, shrink only if larger than maxWidth&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxWidth&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// toBlob with 'image/jpeg' + quality does the compression&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBlob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image/jpeg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quality&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;loadImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onerror&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createObjectURL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&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;Quality &lt;code&gt;0.8&lt;/code&gt; is the sweet spot in my experience: files shrink dramatically with no visible difference for web use. Drop to &lt;code&gt;0.6&lt;/code&gt; for thumbnails, raise to &lt;code&gt;0.9&lt;/code&gt; when quality matters more than size.&lt;/p&gt;

&lt;h2&gt;
  
  
  The details that make it feel like a real tool
&lt;/h2&gt;

&lt;p&gt;The compression is the easy part. The UX around it is what makes people come back:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drag and drop&lt;/strong&gt; — handle &lt;code&gt;dragover&lt;/code&gt;/&lt;code&gt;drop&lt;/code&gt; events, accept multiple files at once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before/after sizes&lt;/strong&gt; — show the original KB and the compressed KB side by side. People love seeing "2.4 MB → 380 KB".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch download&lt;/strong&gt; — loop over files, compress each, and offer a single ZIP or individual downloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory hygiene&lt;/strong&gt; — call &lt;code&gt;URL.revokeObjectURL()&lt;/code&gt; after you're done, or a long session leaks memory with every image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why client-side wins for tools like this
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; a photo never leaves the device. For personal photos, that's the feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; no upload time, no queue, no server round-trip. Compression of a typical photo takes well under a second.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; static hosting. No server to scale, no bandwidth bill for other people's photos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability:&lt;/strong&gt; nothing to go down. If the page loads, the tool works — even offline after the first load.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The limits (honestly)
&lt;/h2&gt;

&lt;p&gt;Canvas compression isn't magic. It can't beat a dedicated encoder on every image, PNG transparency needs care (JPEG has no alpha channel — draw onto a white background first or keep PNG output), and very large images can still spike memory. For a free web tool, though, it's more than good enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The compressor is live at &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;toolenix.com&lt;/a&gt; — free, no sign-up, and your images never leave your browser. The whole site is built on the same idea: 113 tools, all client-side.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Building Client-Side Developer Tools: Why Your Browser Is the Best Server</title>
      <dc:creator>Toolenix</dc:creator>
      <pubDate>Thu, 15 Oct 2026 15:35:01 +0000</pubDate>
      <link>https://dev.to/toolenix/building-client-side-developer-tools-why-your-browser-is-the-best-server-4imj</link>
      <guid>https://dev.to/toolenix/building-client-side-developer-tools-why-your-browser-is-the-best-server-4imj</guid>
      <description>&lt;p&gt;Developers reach for servers by default. Need to format JSON? Spin up an API. Validate a JWT? Send it to a backend. But here's the thing — your browser can do all of this, faster and more privately.&lt;/p&gt;

&lt;p&gt;I built 113 free tools at &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;Toolenix&lt;/a&gt;, all running 100% client-side. Here are the patterns I use for common developer tools:&lt;/p&gt;

&lt;h2&gt;
  
  
  JSON Formatter/Validator
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;parsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Error: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it live: &lt;a href="https://toolenix.com/tools/json-formatter" rel="noopener noreferrer"&gt;JSON Formatter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No server roundtrip. Instant feedback. The user's data never leaves their machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  JWT Decoder
&lt;/h2&gt;

&lt;p&gt;A JWT is just three base64url-encoded segments. Decoding is trivial:&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;function&lt;/span&gt; &lt;span class="nf"&gt;decodeJWT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;atob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;atob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&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;Try it live: &lt;a href="https://toolenix.com/tools/jwt-decoder" rel="noopener noreferrer"&gt;JWT Decoder&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Signature verification needs the secret — but decoding for inspection is pure client-side.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Regex Tester
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;testRegex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;testString&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RegExp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;testString&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;regex&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`Invalid regex: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Client-Side Wins
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt; — sensitive tokens, API keys in JSON, proprietary regex patterns never hit a server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt; — zero network latency, instant results&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability&lt;/strong&gt; — works offline, no server to go down&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt; — static hosting is essentially free at any scale&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Static HTML/CSS/JS on a CDN&lt;/li&gt;
&lt;li&gt;No backend, no database, no API keys&lt;/li&gt;
&lt;li&gt;All computation in the browser's JS engine&lt;/li&gt;
&lt;li&gt;localStorage for persistence (never a server)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next time you're about to build a backend for a utility tool, ask: "Can the browser do this?" The answer is usually yes.&lt;/p&gt;

&lt;p&gt;All 113 tools are live at &lt;a href="https://toolenix.com" rel="noopener noreferrer"&gt;toolenix.com&lt;/a&gt; — free, no sign-up, open in your browser.&lt;/p&gt;

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