The result is 800 kg/m³. Below is a way to derive that answer, check related units, and specify a small converter that explains its work. The examples use supplied numbers without assigning them to a real material.

Follow the cubic denominator
Start with 1 g/cm³. One gram is 0.001 kg, and one centimeter is 0.01 m. The denominator is a cubic centimeter, so cube the length conversion:
1 cm³ = (0.01 m)³ = 0.000001 m³
1 g/cm³ = 0.001 kg / 0.000001 m³ = 1000 kg/m³
The NIST mass-divided-by-volume table confirms the factor of 1000 from g/cm³ to kg/m³. It also lists 1 L as 0.001 m³. These are unit relationships; they do not establish a substance's density.
One mL is one cm³, so g/mL and g/cm³ have the same numeric conversion. One kg/L is also 1000 kg/m³. In contrast, 1 g/L is 0.001 kg divided by 0.001 m³, giving 1 kg/m³. That last equality is easy to miss when similar-looking unit labels sit next to each other.
Use one reference unit
A bounded converter can normalize every supported input to kg/m³, then convert to the requested output. Let F(unit) mean the multiplier that takes one unit of that density to kg/m³.
| Supported density unit | F(unit) |
|---|---|
| kg/m³ | 1 |
| g/cm³ | 1000 |
| g/mL | 1000 |
| kg/L | 1000 |
| g/L | 1 |
For value x, calculate x × F(from) ÷ F(to). The five-row table is this example's supported scope, rather than a list of every possible density unit. Labels should identify both the mass and volume parts, including the exponent on cubic units.
Check the same quantity in different forms
| Supplied record | Requested form | Expected result |
|---|---|---|
| 0.8 g/mL | kg/m³ | 800 kg/m³ |
| 800 kg/m³ | kg/L | 0.8 kg/L |
| 1000 g/L | g/cm³ | 1 g/cm³ |
| 2.5 g/cm³ | kg/m³ | 2500 kg/m³ |
| 2.5 g/cm³ | g/cm³ | 2.5 g/cm³ |
For the first row, 0.8 × 1000 ÷ 1 = 800. For the third, 1000 × 1 ÷ 1000 = 1. Converting to the identical unit uses a factor of one and leaves the quantity unchanged.
Keep the original entry and selected units in the calculation record. A bare result such as “800” cannot show whether the denominator was cubic meters, liters, or something else. A useful result includes its unit and the factor trace together.
Do not turn a unit change into a material assumption
Grams and milliliters alone describe different quantities. To compute mass from volume, you need an independently supplied density for the relevant material and conditions. Choosing g/mL in a unit menu does not supply that density.
For example, “convert 25 mL to grams” is outside this converter's task. It lacks a density value. Leave that request unresolved rather than inserting a water default. Similarly, the supplied 0.8 g/mL fixture is a number for practicing conversion, not a claim about a named liquid or its temperature.
Make invalid and rounded results clear
For this educational helper, accept positive finite dot-decimal inputs with up to six decimal places and values no greater than 1,000,000,000. Require a digit before the decimal point. Reject blanks, zero, negatives, commas, scientific notation, and units outside the five supported choices. This positive-only boundary is the tool's declared input scope, not a universal statement that density can never be zero.
Changing an input or unit clears the old result until Convert produces a new valid record. An error must not leave the previous number looking current. Reset empties the input and record and restores the initial unit choices.
Keep the calculation value unrounded; limit the display to six decimal places and identify any rounding. A positive result smaller than 0.000001 should display as “less than 0.000001” with its unit, rather than appearing to be a genuine zero. Display digits do not establish measurement precision.
Swap uses the stored unrounded result as the new input and reverses the unit choices. Enable it only when that value fits the declared input range and six-place decimal scope; otherwise explain why the reverse entry is unavailable. A displayed rounded value must never silently become the input for the reverse calculation.
Copyable converter prompt
Create an original self-contained HTML/CSS/JavaScript density-unit helper with readable source and an acceptance-test report. This converts a supplied density; no material lookup or default density.
Use exactly kg/m3, g/cm3, g/mL, kg/L and g/L, with visible superscript exponents and explicit mass-per-volume labels. Canonical kg/m3 factors are respectively 1,1000,1000,1000,1. Calculate x*F(from)/F(to) only after full validation. Show original entry, units, normalized kg/m3 value, output unit and factor trace. Include the derivation 1 g/cm3 = 0.001 kg/(0.01 m)^3 = 1000 kg/m3; explain 1 mL=1 cm3 and 1 L=0.001 m3.
Scope: positive finite dot decimals, a digit before the decimal, up to six fractional digits, maximum 1000000000. Reject blank, zero, negative, comma, scientific notation, nonfinite and unsupported-unit input without retaining a stale result. Input/unit changes clear the old record until a valid Convert. Initial units g/mL to kg/m3; Reset empties entry/result and restores those choices.
Keep an unrounded internal result; display up to six decimals, mark rounding and never imply measured precision. Positive values below 0.000001 display '<0.000001' with unit, not an apparent zero. Swap reverses units using the stored unrounded result only if it fits the input range and six-place decimal scope; otherwise disable it with a reason. Never recycle rounded display text as input.
Test 0.8 g/mL -> 800 kg/m3 -> 0.8 kg/L; 1000 g/L -> 1 g/cm3; 2.5 g/cm3 -> 2500 kg/m3; identity conversion; allowed round trips; invalid-after-valid stale clearing; tiny positive display; disabled Swap outside scope. Use native labeled Value/From/To and Convert/Swap/Reset with text status. Explain that grams-to-mL needs independently supplied density and is outside this helper; no water/material/temperature assumption or laboratory instructions.
Check figures, unit identity, errors, keyboard focus, actual article width and 360 px. Mark unexecuted checks not_tested. Do not claim completed runtime, storage, export or host compatibility without evidence.
Keep the derivation beside the result
The native calculation record should retain the supplied density and dimensional trace. If you prepare an HTML helper in NOS, its supplied documentation supports HTML saving and rendering; verify conversion, invalid-state clearing, and Swap in the actual workspace before relying on that version's controls. Explore NOS with prepared HTML, keeping the cubed denominator visible so the next conversion can be checked from units as well as digits.