<?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: Manpreet Singh</title>
    <description>The latest articles on DEV Community by Manpreet Singh (@manpreet1710).</description>
    <link>https://dev.to/manpreet1710</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%2F975779%2F9f8632b0-79e4-4806-a964-de7867e5c921.jpeg</url>
      <title>DEV Community: Manpreet Singh</title>
      <link>https://dev.to/manpreet1710</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manpreet1710"/>
    <language>en</language>
    <item>
      <title>How I Built a Privacy-First Height Comparison Tool That Runs Entirely in the Browser</title>
      <dc:creator>Manpreet Singh</dc:creator>
      <pubDate>Sat, 31 Oct 2026 09:52:28 +0000</pubDate>
      <link>https://dev.to/manpreet1710/how-i-built-a-privacy-first-height-comparison-tool-that-runs-entirely-in-the-browser-4cle</link>
      <guid>https://dev.to/manpreet1710/how-i-built-a-privacy-first-height-comparison-tool-that-runs-entirely-in-the-browser-4cle</guid>
      <description>&lt;p&gt;Ever argued with a friend about who's taller? Or wondered how you'd look standing next to your favourite actor? I kept running into this, and most height comparison sites I tried either felt cluttered or uploaded my photos to a server. So I built &lt;strong&gt;&lt;a href="https://heightcanvas.com/" rel="noopener noreferrer"&gt;HeightCanvas&lt;/a&gt;&lt;/strong&gt;, a free height comparison tool that runs entirely in the browser.&lt;/p&gt;

&lt;p&gt;Here's what I learned building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core problem: one baseline, one scale
&lt;/h2&gt;

&lt;p&gt;A height comparison only works if every figure stands on the &lt;strong&gt;same baseline&lt;/strong&gt; and uses the &lt;strong&gt;same proportional scale&lt;/strong&gt;. That sounds obvious, but it's where most quick implementations break:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every subject is drawn from the floor up, never centered vertically.&lt;/li&gt;
&lt;li&gt;The scale is computed from the &lt;strong&gt;tallest&lt;/strong&gt; subject in the chart, so adding a 216 cm basketball player and a 100 cm child still keeps both readable.&lt;/li&gt;
&lt;li&gt;When subjects change, the scale recalculates automatically, so small differences (like 5 cm) stay visible instead of getting squashed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Units without the headache
&lt;/h2&gt;

&lt;p&gt;Users think in different units. Some type &lt;code&gt;180 cm&lt;/code&gt;, others &lt;code&gt;5'11"&lt;/code&gt;. Internally I store everything in centimetres and only convert for display:&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="nx"&gt;cmToFtIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cm&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;totalIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cm&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;2.54&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;ft&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;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;totalIn&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&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;inch&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;totalIn&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;ft&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&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;inch&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;12&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="nx"&gt;ft&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ft&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="nx"&gt;inch&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Storing one canonical unit removes a whole category of rounding bugs. The tool then shows the exact difference at the top (for example, &lt;em&gt;"Alex is 15 cm (6 in) taller"&lt;/em&gt;) so nobody has to do the subtraction themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy by design
&lt;/h2&gt;

&lt;p&gt;Users can upload their own photo to place in the chart. Instead of sending it anywhere, the image is read locally with the &lt;strong&gt;HTML5 File API&lt;/strong&gt; and never leaves the device. No account, no server upload, no tracking of personal images. For a tool people use with selfies and couple photos, this felt non-negotiable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sharing without a backend
&lt;/h2&gt;

&lt;p&gt;Two ways to share a result:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Export as HD PNG&lt;/strong&gt;, rendered client-side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share via URL&lt;/strong&gt;, where the chart state (names, heights, colours) is encoded in the link, so the recipient sees the exact same comparison.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No database needed for either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready-made comparisons
&lt;/h2&gt;

&lt;p&gt;Blank tools can feel empty, so I added a library of celebrity heights and pre-built pages like Ronaldo vs Messi, LeBron vs Curry, and Shah Rukh Khan vs Salman Khan. They double as examples of what the tool can do.&lt;/p&gt;

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

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://heightcanvas.com/" rel="noopener noreferrer"&gt;heightcanvas.com&lt;/a&gt;&lt;/strong&gt;: compare two or more people, couples, celebrities, or objects in cm, m, or ft/in.&lt;/p&gt;

&lt;p&gt;I'd love feedback from other devs, especially on the scaling logic and mobile UX. What would you add?&lt;/p&gt;

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