http://www.awitness.org/delphi_pascal_tutorial/index.html If you ever need to convert a hexadecimal number in the form of a string into an integer value, this function will perform the task. Some possible improvements. Do an uppercase on the string and save a few lines of code in the case statement. There might also be an exponential function built into Delphi (I didn't look). No error checking is included here (checking for valid Hex numbers and letters in the input string). unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; {integer to string} Button1: TButton; Edit2: TEdit; {hex string} StaticText1: TStaticText; {Hex string} StaticText2: TStaticText; {integer} procedure Button1Click(Sender: TObject); function HexStringToInt(hexnum:string):integer; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text:=IntToStr(HexStringToInt(Edit2.Text)); end; function TForm1.HexStringToInt(hexnum:string):integer; var s:char; s_ord:integer; i, j:integer; hnum:integer; sixteen: integer; begin result:=0; hnum:=0; for i:=length(hexnum) downto 1 do begin s:=hexnum[i]; s_ord:=ord(s); case s_ord of ord('0') : hnum:=0; ord('1') : hnum:=1; ord('2') : hnum:=2; ord('3') : hnum:=3; ord('4') : hnum:=4; ord('5') : hnum:=5; ord('6') : hnum:=6; ord('7') : hnum:=7; ord('8') : hnum:=8; ord('9') : hnum:=9; ord('A') : hnum:=10; ord('a') : hnum:=10; ord('B') : hnum:=11; ord('b') : hnum:=11; ord('C') : hnum:=12; ord('c') : hnum:=12; ord('D') : hnum:=13; ord('d') : hnum:=13; ord('E') : hnum:=14; ord('e') : hnum:=14; ord('F') : hnum:=15; ord('f') : hnum:=15; end; {case} if i=length(hexnum) then result:=hnum {simulate exponential function} else begin sixteen:=1; for j:=length(hexnum)-i downto 1 do sixteen := sixteen * 16; result:=result + (hnum * sixteen); end; end; {for loop} end; {hext to int function} procedure TForm1.FormCreate(Sender: TObject); begin Form1.Height:=198; Form1.Width:=236; end; end.