 <p>The characters that represent decimal digits are laid out in ASCII space in numerical order. </p> <ul> <li><code>'0'</code> is ASCII 0x30</li> <li><code>'1'</code> is ASCII 0x31</li> <li><code>'2'</code> is ASCII 0x32</li> <li>and so on.</li> </ul> <p>This means that you can simply subtract <code>'0'</code> from your character to get the value you desire.</p> <pre><code>char a = ...; if (a &gt;= '0' &amp;&amp; a &lt;= '9') { int digit = a - '0'; // do something with digit } </code></pre>