DAC output voltage calculator
An 8-bit converter with a 5 V reference turns code 128 into exactly 2.5 V. Enter the digital code, the reference voltage and the resolution to get the output, the size of one step, the full scale and the number of levels. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Code
- 128
- V ref
- 5
- Bits
- 8
- Levels
- 256 V
- Max code
- 255
- Lsb
- 0.01953125
- Lsb volts
- 0.01953125
A digital-to-analog converter maps an integer input word onto a stepped analog voltage set by the reference and the converter resolution. Students, embedded engineers, and lab technicians constantly need the ideal transfer: divide the code by two to the power of the bit depth and multiply by the reference so that zero code is ground (or zero volts on a unipolar scale) and the maximum code approaches full scale one least-significant-bit below the reference. This DAC output voltage calculator accepts a digital code, a reference voltage in volts, and an integer bit resolution from one to thirty-two, applies the binary unipolar formula Vout equals Vref times code over two to the bits, and returns the output voltage together with the LSB size, full-scale voltage, number of levels, and a printable expression.
How ideal binary DAC output voltage is computed
An ideal n-bit binary digital-to-analog converter divides the reference voltage into two to the n equal steps and selects the step indexed by the digital code. With code D written as an integer from zero through two to the n minus one, the standard unipolar binary formula is Vout equals Vref times D divided by two to the n.
The least-significant-bit size is therefore Vref over two to the n, and the full-scale code produces Vref times (two to the n minus one) over two to the n, which is one LSB below the reference rather than exactly equal to it. That one-LSB gap is intentional in binary-weighted and R-2R ladder models: the all-ones code never quite reaches Vref when the transfer is written over two to the n steps.
Bit resolution must be a whole number between one and thirty-two inclusive so that two to the n stays a practical power-of-two integer and the max code remains an exact safe integer. Code zero always yields zero output regardless of Vref, code half of two to the n yields half the reference for even n, and a negative reference simply flips the sign of every step while keeping the same relative fractions.
Where DAC output calculators show up in real work
Introductory electronics and microcontroller labs assign DAC transfer drills so students can convert a register value into expected millivolts before they probe a pin with a multimeter or scope. Firmware bring-up teams size bias voltages, LED current DACs, and audio soft-start ramps by computing ideal Vout for each programmed code and comparing against measured rails within tolerance. Analog and mixed-signal designers use the same product when sketching unipolar R-2R ladders or checking that a chosen bit depth meets a required LSB in volts under a fixed reference.
Keep bipolar offset models, differential non-linearity tables, and the alternate full-scale denominator two to the n minus one as separate landings so each search intent has one clear page rather than an overloaded multi-formula tool that confuses both students and search engines.
What you can do with it
Lab homework and multimeter checks
Convert an n-bit code and reference into ideal Vout so students can predict the voltage before measuring a DAC pin on the bench.
Firmware bias and soft-start ramps
Map programmed register values to expected millivolts when bringing up bias rails, LED current DACs, or audio soft-start sequences.
FAQ
What formula does this DAC output voltage calculator use?
Ideal unipolar binary DAC: Vout = Vref × code / 2^bits. LSB = Vref / 2^bits. Full-scale (all ones) is one LSB below Vref.
What range is valid for the digital code?
An integer from 0 through 2^bits − 1 inclusive.
Why is full scale not exactly equal to Vref?
With a binary (power-of-two) denominator the max code is 2^n − 1, so full scale is Vref × (2^n − 1) / 2^n, one LSB below the reference.
What bit depths are supported?
Integer bits from 1 to 32 inclusive. That covers common 8-, 10-, 12-, 16-, and 24-bit converters while keeping 2^n exact for max-code arithmetic.
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/elec/dac-output \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"code":128,"v_ref":5,"bits":8}'const res = await fetch("https://api.kit.forhosting.com/elec/dac-output", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"code": 128,
"v_ref": 5,
"bits": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/dac-output",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"code": 128,
"v_ref": 5,
"bits": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/dac-output", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"code":128,"v_ref":5,"bits":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"code":128,"v_ref":5,"bits":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/dac-output", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"code": 128,
"v_ref": 5,
"bits": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.dac_output",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Out-of-range codes and non-integer bit depths fail with a clear invalid_input message instead of wrapping silently. Successful calls cost the published $0.002 base price; validation failures are not billed.
How ideal binary DAC output voltage is computed
A different textbook convention sometimes normalizes against two to the n minus one so that full scale equals Vref exactly; this capability deliberately uses the binary-power denominator so firmware that multiplies code by Vref and right-shifts by n matches the JSON result.
What you send and what you get back
Only one key may appear for each quantity so the chosen value is unambiguous. Classic checks include an eight-bit converter with five-volt reference and code one hundred twenty-eight giving exactly two point five volts, a twelve-bit rail with three point three volts and code zero giving zero, and a ten-bit part with code one thousand twenty-three approaching but not equaling the reference by one LSB. Wire the free browser form for homework and bench sanity checks, then call the identical contract from scripts when you need bulk answer keys or firmware test vectors. POST a JSON object with three required fields: code as the integer digital word, v_ref as the finite reference voltage in volts, and bits as the integer resolution from one to thirty-two. The same code is accepted under the aliases digital_code, d, input_code, or value; the reference under vref, Vref, V_ref, reference, or reference_voltage; and the resolution under n, bit_resolution, resolution, or bit_depth. Numeric JSON numbers and numeric strings are both accepted for form widgets and spreadsheet paste; unit suffix strings such as five V written as text are not parsed. Missing fields, empty strings, NaN, Infinity, non-integer code or bits, bits outside one through thirty-two, and codes outside zero through two to the bits minus one fail with invalid_input naming the problem and are not billed. On success the body includes cleaned code, bits, and v_ref; levels equal to two to the bits; max_code equal to levels minus one; lsb and lsb_volts as the step size; v_out and voltage_out as the same analog result; full_scale and full_scale_voltage for the all-ones code; fraction as code over levels; unit set to V; formula Vout equals Vref times code over two to the bits; a short expression string substituting the numbers; and method dac_binary_unipolar. Pricing for successful API calls is the published base of $0.002 per item.
Integration use cases
CI fixtures and answer keys
Script the same Vout = Vref × code / 2^n product used in the browser so automated graders and production DAC walk tests share one ground truth.