Skip to the tool
DevToolBench

Units, time & colour

Convert bytes between decimal and binary units, colours between CSS notations, Unix timestamps to dates, and count the days between two dates.

These converters share a problem: the same quantity has more than one standard way of being written, and the standards disagree in ways that are easy to miss. A megabyte is either a million bytes or 1,048,576. A colour is the same pixel in hex and in OKLCH, but only one of those notations can describe colours outside the sRGB gamut. A timestamp is a single number until someone has to decide whether it counts seconds or milliseconds.

The byte converter puts the decimal scale (kB, MB, GB, powers of 1000) and the binary scale (KiB, MiB, GiB, powers of 1024) side by side. That gap is why a 1 TB drive shows up as about 931 GB in Windows: the manufacturer counted in powers of 1000, the operating system divides by 1024 and still prints "GB". Storage vendors and network speeds use the decimal scale; memory sizes and many operating systems use the binary one.

The colour converter translates between six CSS notations, including hex, RGB, HSL and OKLCH, names the nearest CSS colour, and gives the WCAG contrast ratio against pure black and pure white. Contrast is the figure worth checking every time: body text needs at least 4.5:1 against its background to meet WCAG AA, and a brand colour that looks fine in a mock-up often fails that on a phone in daylight.

For time, the Unix timestamp converter turns epoch values into dates and back, in seconds or milliseconds. The quickest sanity check is the number of digits: a current timestamp has ten digits in seconds and thirteen in milliseconds, and mixing them up puts a date in January 1970 or tens of thousands of years from now. The date difference calculator counts days, weeks, months and working days between two dates. Months are the slippery unit, because they have no fixed length, so the page anchors them on the start date and says so. For times that repeat rather than intervals, the cron expression generator is the right tool.