JTBarton.com

Skip Navigation Links
Home
Barcode overview
SQL playground
Web Cameras
Personal information
Developer links
About Web Host
Contact Me
Sign In

Free Barcode Font - Code 39

Code 39 is the simplest of all the barcode formats, and I believe that it was the first barcode to become an acknowledge standard. It can produce variable length codes that can be read in either direction and may incorporates a checksum for built in validation but this is not mandatory. The characters available are limited to upper case alphabetical characters, numbers and some punctuation codes (-) minus, (+) plus, (.) period, ($) dollar symbol, (/) forward slash, (%) percentage symbol and (space).

To ensure that a scanner/reader is aware when the barcode starts and stops there is a termination character usually represented by a * which delimits either end of the barcode.

A full list of all the available characters is shown in the table at the bottom of this page

Checksum calculation

The checksum for code 39 is optional, and is calculated by adding the value of the character position to the character number and then applying a modulus of 43, this is probably best explained with a example:

Lets encode the word “BARCODE
Character Value
B 11
A 10
R 27
C 12
O 24
D 13
E 14
Total 111

This results in a modulus of 25, i.e. 111 / 43 = 2 remainder 25, so the checksum value is 25 represented by the 'P' character.
So the fully encoded barcode becomes: start char(*)+11(B)+10(A)+27(R)+12(C)+24(O)+13(D)+14(E)+25(P)+stop char(*)

As you can see from the above this is quite easy to calculate, but it still can become a little tricky when converting to / from Code 39 values to ASCII values especially when punctuation is used either within the string itself or calculated by the checksum.


Free Barcode Font (code 39) and String Builder

Font

The code 39 font is freely available for download, no catches, no costs, just free.
 Click to download Code 39 Font
To install the font, click on the barcode above and then select 'Save' placing the file into the %WinDir%\Fonts folder.
For most users this folder will be: C:\Windows\Fonts

The font was originally created by grandzebu.net, although there is checksum calculator available on this site, see string builder below.

String Builder

A small static class written in C# is also available to generate the required output characters is available free from here. This is provided as a .net assembly for use in any .net language, the source code is also available along with coding examples.

Code 39 definition table

Character

Value

Pattern

Character

Value

Pattern

Character

Value

Pattern

0

0

 101000111011101

F

15

101110111000101

U

30

111000101010111

1

1

 111010001010111

G

16

 101010001110111

V

31

100011101010111

2

2

 101110001010111

H

17

 111010100011101

W

32

111000111010101

3

3

 111011100010101

I

18

 101110100011101

X

33

100010111010111

4

4

 101000111010111

J

19

 101011100011101

Y

34

111000101110101

5

5

 111010001110101

K

20

 111010101000111

Z

35

100011101110101

6

6

 101110001110101

L

21

 101110101000111

-

36

100010101110111

7

7

101000101110111

M

22

 111011101010001

.

37

111000101011101

8

8

 111010001011101

N

23

 101011101000111

Space

38

100011101011101

9

9

 101110001011101

O

24

 111010111010001

$

39

100010001000101

A

10

 111010100010111

P

25

 101110111010001

/

40

100010001010001

B

11

101110100010111

Q

26

101010111000111

+

41

100010100010001

C

12

111011101000101

R

27

111010101110001

%

42

101000100010001

D

13

101011100010111

S

28

101110101110001

 

 

 

E

14

111010111000101

T

29

101011101110001

*

 

100010111011101