<?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: Kamran Ashraf</title>
    <description>The latest articles on DEV Community by Kamran Ashraf (@kamrandev10).</description>
    <link>https://dev.to/kamrandev10</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%2F4273740%2F69a40b63-38e1-456e-9651-ad0861cde1fc.png</url>
      <title>DEV Community: Kamran Ashraf</title>
      <link>https://dev.to/kamrandev10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kamrandev10"/>
    <language>en</language>
    <item>
      <title>How I built a 270-page unit converter with Next.js (and tested every factor against NIST)</title>
      <dc:creator>Kamran Ashraf</dc:creator>
      <pubDate>Mon, 30 Nov 2026 09:09:21 +0000</pubDate>
      <link>https://dev.to/kamrandev10/how-i-built-a-270-page-unit-converter-with-nextjs-and-tested-every-factor-against-nist-37n4</link>
      <guid>https://dev.to/kamrandev10/how-i-built-a-270-page-unit-converter-with-nextjs-and-tested-every-factor-against-nist-37n4</guid>
      <description>&lt;p&gt;I recently launched Unitrify (&lt;a href="https://unitrify.com" rel="noopener noreferrer"&gt;https://unitrify.com&lt;/a&gt;), a free unit converter that covers 76 categories and nearly 600 units, from everyday length and weight to pressure, energy, data storage and currency. Here's how it's built and what I learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why another unit converter?
&lt;/h2&gt;

&lt;p&gt;Most converters I used were slow, full of pop-ups, or never showed how the answer was calculated. Some got regional units wrong. I wanted one clean place where every page shows the formula, a few worked examples and a conversion table.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js (App Router)&lt;/strong&gt; with plain JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; for styling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vercel&lt;/strong&gt; for hosting&lt;/li&gt;
&lt;li&gt;Almost every page is &lt;strong&gt;statically generated&lt;/strong&gt; at build time, so pages load fast and the full content is in the HTML for search engines&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One small engine for every unit
&lt;/h2&gt;

&lt;p&gt;Every unit is stored as data, not code. Each one has a "kind":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linear:&lt;/strong&gt; base = value × factor (most units, e.g. meters, kilograms)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Affine:&lt;/strong&gt; base = value × factor + offset (temperatures like °F)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inverse:&lt;/strong&gt; base = factor ÷ value (e.g. fuel consumption, L/100 km vs mpg)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Converting is always: input → base unit → output. Adding a new unit means adding one line of data, not writing a new function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing against NIST
&lt;/h2&gt;

&lt;p&gt;Unit factors are easy to get slightly wrong. So I wrote an independent reference table from NIST SP 811 and exact SI definitions, and a test compares every unit in the engine against it. The test suite also checks every table row, every reverse pair (A→B→A returns the original value) and every quick answer shown in page titles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Smart search
&lt;/h2&gt;

&lt;p&gt;The search box understands queries like &lt;code&gt;100 cm&lt;/code&gt;, &lt;code&gt;5 ft 4 in&lt;/code&gt;, &lt;code&gt;kg to lbs&lt;/code&gt; or &lt;code&gt;100 usd to pkr&lt;/code&gt;. A small parser pulls out the number, the units and the direction, handles common typos, and shows the answer instantly, before you even open a page.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;Launching ~280 pages at once on a brand-new domain was a lesson: search engines take time to trust a new site, and internal linking matters a lot. Your most important pages should get the most links from the rest of the site.&lt;/p&gt;

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

&lt;p&gt;It's free, with no sign-up: &lt;a href="https://unitrify.com" rel="noopener noreferrer"&gt;https://unitrify.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love feedback, especially on units or features you'd like to see added.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
