The display
How a hex editor works
A hex editor is a view onto a numbered list. Position 0 is the first byte of the file. Position 1 is the next. The number of a byte, counted from the start, is its offset. Editors usually print offsets in hexadecimal too, so 10 means sixteen bytes in, not ten.
The three columns
Almost every hex editor lays a row out the same way. On the left, the offset of the first byte in that row. In the middle, the bytes themselves, almost always sixteen of them, because sixteen is a round number in hex (0x10). On the right, those same sixteen bytes interpreted as text.
00000000 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 .PNG........IHDR89is not a letter in ASCII, so the text column draws a dot. The byte is still 137. A dot is a stand-in, not the character “.” (that character would be the byte2E).50 4E 47is the letters P, N, and G. Together with the leading byte, this is the PNG signature.0D 0Ais a carriage return and a line feed.1Ais another control byte, and0Ais a line feed again. They are here because the PNG signature was designed that way, not because the image contains four blank lines.00 00 00 0Dis the number 13, written as a four-byte integer. It says the following header is 13 bytes long.49 48 44 52is the letters I, H, D, R: the name of that header.
Why hexadecimal
You could write every byte in decimal, from 0 to 255. Hex is used because a byte is eight bits, and each hex digit is four bits, so one byte is always exactly two digits. 0A and FF take the same space. Decimal 10 and decimal 255 do not, and the columns would wobble.
The prefix people write in prose, 0x, is not stored in the file. It only marks a number as hexadecimal when it appears in a sentence. Inside the editor the digits stand alone.
Editing is changing a number
If you change 48 to 4A in the word Hello, the H becomes a J, because those two numbers are the codes for those two letters. The editor did not edit a document. It replaced one byte with another.
The same kind of replacement inside a photo or a database can make the file unreadable, because that byte was a length, a checksum, or part of a compressed stream. The editor has no way to know the difference. The format does.
What the editor is not showing you
The display answers “which bytes are here?” It does not answer “what do they mean?” A four-byte integer, a date, and a short string can all look like four ordinary hex pairs until you know which one you are on. Templates exist for that next step: you describe the fields once, and the editor labels them instead of leaving you to count.