<?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: Dreisatz Rechner</title>
    <description>The latest articles on DEV Community by Dreisatz Rechner (@dreisatz_rechner_b1d03b05).</description>
    <link>https://dev.to/dreisatz_rechner_b1d03b05</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%2F4269045%2Fbee80c36-2d38-43c5-be1a-9cc68d7fd9f4.png</url>
      <title>DEV Community: Dreisatz Rechner</title>
      <link>https://dev.to/dreisatz_rechner_b1d03b05</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dreisatz_rechner_b1d03b05"/>
    <language>en</language>
    <item>
      <title>How I Built a Simple Dreisatz Calculator with HTML, CSS and JavaScript</title>
      <dc:creator>Dreisatz Rechner</dc:creator>
      <pubDate>Tue, 01 Dec 2026 04:54:47 +0000</pubDate>
      <link>https://dev.to/dreisatz_rechner_b1d03b05/how-i-built-a-simple-dreisatz-calculator-with-html-css-and-javascript-c3g</link>
      <guid>https://dev.to/dreisatz_rechner_b1d03b05/how-i-built-a-simple-dreisatz-calculator-with-html-css-and-javascript-c3g</guid>
      <description>&lt;h1&gt;
  
  
  How I Built a Simple Dreisatz Calculator with HTML, CSS and JavaScript
&lt;/h1&gt;

&lt;p&gt;I wanted to build a small browser-based calculator that could make the German Dreisatz method easier to understand and use.&lt;/p&gt;

&lt;p&gt;The project uses only &lt;strong&gt;HTML, CSS and JavaScript&lt;/strong&gt;, so there are no external libraries or frameworks required.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Dreisatz?
&lt;/h2&gt;

&lt;p&gt;Dreisatz is a common mathematical method for solving proportional relationships.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;If 500 g of mushrooms cost €3.85, how much would 200 g cost?&lt;/p&gt;

&lt;p&gt;The calculation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;500 g → €3.85
200 g → x

x = (3.85 × 200) / 500
x = €1.54
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Building the calculator
&lt;/h2&gt;

&lt;p&gt;The calculator has three input fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Original quantity&lt;/li&gt;
&lt;li&gt;Original value&lt;/li&gt;
&lt;li&gt;New quantity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JavaScript then calculates the unknown value using:&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result can then be displayed directly in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I used vanilla JavaScript
&lt;/h2&gt;

&lt;p&gt;For a small calculator like this, a framework is not necessary.&lt;/p&gt;

&lt;p&gt;Vanilla JavaScript keeps the project lightweight and makes the basic calculation logic easy to understand. It also means that the calculator can run without loading additional libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;A simple example could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;500 g = €3.85
200 g = ?

Result = €1.54
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The calculator can also format the result using the German number format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project
&lt;/h2&gt;

&lt;p&gt;I created a more complete online version of the calculator here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dreisatz Rechner:&lt;/strong&gt; &lt;a href="https://dreisatzberechner.com/" rel="noopener noreferrer"&gt;https://dreisatzberechner.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal is to make proportional calculations simple and accessible directly in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Building a small calculator is a useful way to practice the fundamentals of web development.&lt;/p&gt;

&lt;p&gt;The project helped me work with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML form elements&lt;/li&gt;
&lt;li&gt;CSS layout and styling&lt;/li&gt;
&lt;li&gt;JavaScript calculations&lt;/li&gt;
&lt;li&gt;DOM manipulation&lt;/li&gt;
&lt;li&gt;Number formatting&lt;/li&gt;
&lt;li&gt;Basic user input validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small projects like this are a good way to practice web development because the final result is immediately usable.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
      <category>html</category>
    </item>
  </channel>
</rss>
