HEX to RGB: one color, two spellings
A hex color like #0E6B54 is just three numbers written in base 16 and glued together. Split it into pairs and convert each pair to decimal:
0E = 0×16 + 14 = 14 6B = 6×16 + 11 = 107 54 = 5×16 + 4 = 84
= rgb(14, 107, 84)
Each pair runs 00–FF, which is 0–255 in decimal — the full range of one 8-bit channel. Hex digits above 9 are letters: A=10, B=11, C=12, D=13, E=14, F=15. Three-digit shorthand doubles each digit: #f80 means #ff8800 = rgb(255, 136, 0). The HEX to RGB converter goes both directions and handles the shorthand.
px to rem: divide by the root
A rem is a multiple of the root element’s font size, which is 16px in every mainstream browser unless someone changes it. So the conversion is a single division:
| px | rem (16px root) | Common role |
|---|---|---|
| 4 | 0.25 | Tight spacing unit |
| 8 | 0.5 | Base spacing unit |
| 12 | 0.75 | Caption text |
| 14 | 0.875 | Secondary text |
| 16 | 1 | Body text |
| 20 | 1.25 | Lead paragraph |
| 24 | 1.5 | H3 / large text |
| 32 | 2 | H2 |
| 48 | 3 | H1 / display |
The reason to bother: rem respects the user’s browser font-size setting, so text set in rem scales for people who need it larger, while px ignores them. Sizes that shouldn’t scale with text — borders, hairlines — are the legitimate px holdouts. The px to rem converter also handles custom root sizes for the projects that set html { font-size: 62.5% } to make 1rem = 10px.
Unix time: seconds since 1970
A Unix timestamp counts seconds since 00:00:00 UTC on January 1, 1970 — the epoch. It has no time zone, no DST, no calendar quirks; it is a single integer that every system on earth agrees on, which is why databases and APIs store moments this way.
| Timestamp | UTC date & time | Note |
|---|---|---|
| 0 | 1970-01-01 00:00:00 | The epoch |
| 1,000,000,000 | 2001-09-09 01:46:40 | The billennium |
| 1,800,000,000 | 2027-01-15 08:00:00 | Next round milestone |
| 2,147,483,647 | 2038-01-19 03:14:07 | 32-bit signed limit — the Y2038 problem |
Two gotchas. JavaScript’s Date.now() returns milliseconds, so its values are 1,000× larger — a 13-digit number is milliseconds, 10 digits is seconds. And the 2038 limit only bites systems still storing time in a signed 32-bit integer; 64-bit timestamps are safe for about 292 billion years. Decode any value with the Unix timestamp converter.
Binary, octal, hex: same number, different base
A base tells you what each digit position is worth. In base 10 the columns are 1, 10, 100…; in base 2 they are 1, 2, 4, 8…; in base 16 they are 1, 16, 256…. The number doesn’t change, only its spelling:
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 64 | 1000000 | 100 | 40 |
| 255 | 11111111 | 377 | FF |
| 2026 | 11111101010 | 3752 | 7EA |
Hex earns its place because one hex digit is exactly four binary bits — FF is eight 1s — making it a compact, lossless way to write binary. That is the same reason colors, memory addresses and file permissions (octal, three bits per digit) use these bases. Convert anything up to your patience limit with the number base converter.
Run your own numbers
FAQ
How do I convert a hex color to RGB manually?
Why is 1rem equal to 16 pixels?
How can I tell if a Unix timestamp is in seconds or milliseconds?
What is the Year 2038 problem?
Why do programmers use hexadecimal instead of binary?
Sources
Primary references used for the figures and rules on this page.
- CSS Values and Units (rem definition) — W3C
- Seconds Since the Epoch definition — IEEE / The Open Group (POSIX)