Home

Contact Us

General

Initiative B@bel

WSI Guidelines

Encoding

Principles

Unicode

Training

Tutorials

PUA

Conversion

Resources

Utilities

TECkit

Maps

Resources

Input

Principles

Utilities

Tutorials

Resources

Type Design

Principles

Design Tools

Formats

Resources

Font Downloads

Gentium

Doulos

IPA

Rendering

Principles

Technologies

OpenType

Graphite

Resources

Font FAQ

Links

Glossary


NRSI: Computers & Writing Systems

SIL HOME | SUPPORT | DONATE

You are here: Encoding > Unicode > Training
Short URL: http://scripts.sil.org/HextoDecConversion

How to Convert a Hex Number to a Decimal Number

using the Windows Calculator

Joan Wardell, 2005-07-05

Contents

Goals for this tutorial

This tutorial explains how to find out the decimal value of a hexadecimal number, (using the Windows Calculator) and vice versa. It also explains how Microsoft Word XP handles data from legacy symbol fonts. In the last procedure you can determine the hexadecimal values that Word XP assigns your legacy symbol data. We recommend you read through and try all steps.

This step is part of the procedure How to Write a Conversion Mapping for your Legacy Font.

Converting a hex number to decimal

Instructions are based on a Windows XP operating system.

Click: Start | All Programs | Accessories | Calculator.

Note

You can create a shortcut to the Calculator by right-clicking instead of clicking the Calculator item. Then click Send to | Desktop (create shortcut). Find the new shortcut on your desktop and double-click it to start the Calculator.

If your calculator doesn't look like this, click View and change from Standard to Scientific view.

Note the number base systems list with radio buttons hex, dec, oct, and bin. These represent hexadecimal, decimal, octal, and binary. In the above example, Decimal ( Dec ) is chosen.

Click the  Hex  radio button to change to the hex system (if necessary).

With the mouse, click the hex number you wish to convert. Use the Calculator window's numeric keypad display. As an example, click 3 and then click F. A-F are found on the Calculator below the numbers. They are only usable when the radio button "Hex" is selected.

Note

You do not need to click preceding zeros in any of these conversions. Also, you can type the numbers or letters from the keyboard instead of using the mouse, if you prefer.

"3F" will appear on the Calculator screen. Now click the radio button for decimal ( Dec ). The "3F" is immediately changed to the decimal equivalent "63".

Note

To convert another number, you don't have to delete the one on the Calculator screen. Just click the mouse on the calculator pad. But be sure you have the radio button set correctly first.

Converting a decimal number to hex

Click: Start | All Programs | Accessories | Calculator.

Make sure the  Dec  radio button is on.

Click 63.

Click the Hex radio button. The Calculator displays the correct hexadecimal value of "3F".

Converting a decimal codepoint to PUA

Symbol fonts are older legacy fonts (before Unicode) that were originally used to display symbols rather than alphabetic text. This is an example: Symbol fonts may consist entirely of arrows, mathematical symbols, geometric, engineering, or technical symbols. There is also a class called "dingbats" or "wingdings".

In addition, many Symbol fonts were devised that contained alphabetic characters that were not the standard A-Z set. This allowed users to type in languages other than English. This could include anything from IPA (International Phonetic Alphabet) characters to languages like Hebrew or Devanagari.

Microsoft Word does not convert documents using Symbol fonts to their Unicode equivalents. That would be a very complex operation. Instead it converts all symbol codepoints into a certain set of hexadecimal numbers in the "Private Use Area" or PUA. It can then display them correctly using the old legacy font.

To determine the PUA code that Word will assign a given legacy codepoint:

  • Choose a specific codepoint in your legacy symbol font. If you do not know if your font is a symbol font, see How to Identify Legacy and Other Fonts.
  • Convert the decimal number (this will be between 32 and 255) to hexadecimal. In our example, "63" becomes "3F".
  • Append F0 to the beginning of the hexadecimal number. Thus "3F" becomes "F03F". This is the PUA codepoint that Word will assign legacy codepoint "63" when it opens your legacy document.
  • If you search your text for Unicode value "F03F", it will find all the original "63" codepoints.
  • If you save your legacy document after opening it in Word, it will be saved using the new PUA "F0.." codepoints, not the original legacy codepoints.

Note

Another way to determine the PUA value of a Symbol font codepoint is by using the Calculator. Just add F000 to the hex value. For a decimal value, add 61440. Then convert to hex.

Page History

2008-02-22 JW: reviewed

2005-07-05 JW: Page created


© 2003-2014 SIL International, all rights reserved, unless otherwise noted elsewhere on this page.
Provided by SIL's Non-Roman Script Initiative. Contact us here.