Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuition

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labs

Reference

GlossaryBlogDiscoveries
Tools › Computer Science

Text to ASCII and binary converter

Each character’s ASCII code in decimal, binary and hexadecimal.

01001000 01101001 00100001

  1. 'H' = 72 = 01001000 = 0x48
  2. 'i' = 105 = 01101001 = 0x69
  3. '!' = 33 = 00100001 = 0x21

How it works

ASCII gives each English letter, digit and symbol a number from 0 to 127. A is 65, a is 97, 0 is 48. Computers store those numbers in binary, one byte each.

Worked example

With Text = Hi!:

  1. 'H' = 72 = 01001000 = 0x48
  2. 'i' = 105 = 01101001 = 0x69
  3. '!' = 33 = 00100001 = 0x21

Answer: 01001000 01101001 00100001

Questions

Why is a lower-case letter 32 more than its capital?
The designers put capitals and small letters exactly 32 apart, so flipping one bit (the 32s bit) changes the case.

Learn the method properly

The chapter behind this tool, with animations, an experiment and an AI tutor who checks each step you write.

Open the chapter

More computer science tools

  • Binary, decimal and hex converter
  • Truth table generator
  • Password strength checker
  • File size and download time calculator