About Milligrams to Grams
A single-purpose tool built to do one thing exactly: convert between micrograms, milligrams and grams, and explain the conversion clearly enough that you do not need the tool next time.
Last updated:
What this site is
A converter, and the reasoning behind it
Metric weight conversion is the simplest kind of unit conversion there is. There is exactly one constant — 1 gram = 1,000 milligrams — it never varies by substance or country, and the arithmetic reduces to moving a decimal point.
That simplicity is why most conversion sites treat it as filler. We took the opposite view: if the calculation is trivial, the value has to come from getting everything around it right — exactness, speed, clarity of explanation, and honesty about what the tool cannot tell you.
So the calculator computes exactly rather than approximately, runs entirely in your browser so nothing you type is transmitted anywhere, and shows its working instead of just an answer. The guides exist to explain the contexts where these units actually matter — medication labels, nutrition panels, laboratory work — including where the arithmetic stops being the important part.
Methodology
How the conversion is performed
The constants
Every figure on this site derives from these exact SI relationships:
These are definitions rather than measurements, so they carry no uncertainty and no tolerance. They have been fixed by international agreement since the metric system was formalised, and the 2019 redefinition of the kilogram did not alter them.
- 1 gram = 1,000 milligrams
- 1 milligram = 1,000 micrograms
- 1 gram = 1,000,000 micrograms
Exact decimal arithmetic
Most calculators divide using floating-point numbers, which cannot represent many decimal values exactly. A naive implementation converting 0.1 mg to grams returns 0.00010000000000000002.
This calculator instead shifts the decimal point within the number's exact digit representation — which is what a metric conversion physically is. The result is exact at any magnitude, including values far beyond what double-precision floating point can represent, and converting back and forth returns the original figure precisely.
Rounding. Display rounding is half-up and affects presentation only, never the underlying value. Results show up to ten decimal places, and values below 1 retain at least four significant digits so small conversions do not collapse to zero on screen.
Verification
How we check that it is right
Automated test suite
The conversion engine is covered by tests asserting exact string results — including every specific value published in the conversion chart, round-trip losslessness, and known floating-point failure cases.
Generated, never typed
Every figure in the conversion chart and in the article tables is produced by the same engine that powers the calculator. No conversion figure on this site is hand-entered, so none can drift from the tool.
Single source of constants
The SI factors are defined in one place in the codebase and referenced everywhere else. There is no second copy that could fall out of step.
Editorial standards
How the guides are written
Articles are written to be useful to someone standing in a pharmacy aisle or halfway through a homework sheet, which means the answer comes first and the context follows. Every article opens with a short direct summary before any explanation begins.
Numerical claims are either derived from the SI definitions or are well-established physical figures. Where a figure is approximate — the weight of a paperclip, say — it is described as approximate.
Articles touching on medication carry an explicit disclaimer and are deliberately limited to explaining what units and labels mean. We do not publish dosing guidance, we do not suggest amounts, and we do not compare specific products.
Where an article describes clinical practice — such as the conventions around leading and trailing zeros — it does so to explain why those conventions exist, not as instruction for anyone to follow in a clinical setting.
Privacy
What happens to what you type
Nothing. The conversion runs as JavaScript inside your browser. The values you enter are never sent to a server, never logged and never stored. There is no account, no login and no profile.
The full detail is in the privacy policy.
Corrections
Found something wrong?
If you spot an error — a wrong figure, a misleading explanation, a broken link — we want to know. Accuracy is the entire point of a site like this, and a correction is more useful to us than a compliment.
Get in touch via the contact page.
Try the calculator
Exact results, live as you type, with nothing sent anywhere.