<p>SVG is a vector-graphics format, there's no particular reason it can't scale arbitrarily. Presumably the CNC software will allow you to select the scale of a pixel? If so, pick a scale that makes the math work out easily (so some integer number of pixels per millimeter). If not, it's probably documented somewhere for the specific tool you're using.</p>

CC BY-SA 3.0
2016-12-12T16:41:27.640Z
2016-12-12T16:41:27.640Z
Vivian
<p><strike>I found one of those printer things that puts ink on dead trees and tested to print a simple SVG file.</p>

<pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg"
     width="400px" height="800px"&gt;
  &lt;rect x="10" y="10" width="72" height="72" fill="#999999" /&gt;
  &lt;rect x="10" y="100" width="378" height="378" fill="#999999" /&gt;
&lt;/svg&gt;
</code></pre>

<p>As I suspected 72 pixels came out pretty much exactly 19mm. (72/19.05)*100~=378 came out 100mm.</p>

<p>Given this I am going to assume that 72/19.05 is the de facto best pixel to mm ratio to use for CNC projects.</strike></p>

<p>EDIT:</p>

<p>Found this documentation: <a href="http://w3.org/TR/SVG/coords.html#Units" rel="noreferrer">http://w3.org/TR/SVG/coords.html#Units</a></p>

<pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg"
     width="400px" height="800px"&gt;
  &lt;rect x="10" y="10" width="19.05mm" height="19.05mm" fill="#999999" /&gt;
  &lt;rect x="10" y="100" width="100mm" height="100mm" fill="#999999" /&gt;
&lt;/svg&gt; 
</code></pre>

<p>Much simpler to use mm as units right away </p>

CC BY-SA 3.0
2016-12-12T20:09:00.737Z
2016-12-12T20:34:51.533Z
2016-12-12T20:34:51.533Z
Hampus
<p>I am planning a mechanical 40% keyboard build and are coincidentally on the home stretch of a homemade CNC project.</p>

<p>The only thing the CNC needs to do for the keyboard project is to drill 7*48 holes. So what I need to do now is layout those holes in SVG. Therein lies the question. What resolution should I use for the SVG? I want to space the center of the keyboard switches 19 mm apart. An online pixel to mm converter suggested that 72 pixels is exactly 19.05 mm (which actually is what Cherry MX says should be their spacing).</p>

<p>Now, I do understand that this really doesn't matter, but I am curious as I am new on CNCs and was suspecting that there is a number that will "just work". </p>

<p>EDIT:
For example, if I where to print the template (SVG) on a regular printer, what pixel to mm ratio should I use so that it would come out the size I want?</p>

<resolution>
What resolution (pixels/mm) should I use in SVG for CNC?
Hampus
# What resolution (pixels/mm) should I use in SVG for CNC?

(Asked by: username_0 on 2016-12-11)

I am planning a mechanical 40% keyboard build and are coincidentally on the home stretch of a homemade CNC project.

The only thing the CNC needs to do for the keyboard project is to drill 7\*48 holes. So what I need to do now is layout those holes in SVG. Therein lies the question. What resolution should I use for the SVG? I want to space the center of the keyboard switches 19 mm apart. An online pixel to mm converter suggested that 72 pixels is exactly 19.05 mm (which actually is what Cherry MX says should be their spacing).

Now, I do understand that this really doesn't matter, but I am curious as I am new on CNCs and was suspecting that there is a number that will "just work".

EDIT:
For example, if I where to print the template (SVG) on a regular printer, what pixel to mm ratio should I use so that it would come out the size I want?

**Tags:** resolution

---

## 2 answers

### Answer by username_0 on 2016-12-12. Score: 6 | Accepted answer

I found one of those printer things that puts ink on dead trees and tested to print a simple SVG file.

  
  


As I suspected 72 pixels came out pretty much exactly 19mm. (72/19.05)*100~=378 came out 100mm.
Given this I am going to assume that 72/19.05 is the de facto best pixel to mm ratio to use for CNC projects.
EDIT:
Found this documentation: http://w3.org/TR/SVG/coords.html#Units

  
  
 

Much simpler to use mm as units right away


---

### Answer by username_1 on 2016-12-12. Score: 1

SVG is a vector-graphics format, there's no particular reason it can't scale arbitrarily. Presumably the CNC software will allow you to select the scale of a pixel? If so, pick a scale that makes the math work out easily (so some integer number of pixels per millimeter). If not, it's probably documented somewhere for the specific tool you're using.


---

