Dose-response curves in the browser, checked against R

Paste a dose-response experiment from a spreadsheet and get the fitted curves, EC50s with honest confidence intervals, and a test of whether two compounds really differ. Nothing to install, nothing uploaded, and the numbers match the standard R package to five or six significant figures.

Published
17 November 2026
Run
In the browser
Model
4PL and 5PL logistic
Checked against
R drc, NIST Rat43, SciPy
Stack
Rust, webassembly, svg
Download
100 KB
Open dose
Contents
  1. Paste a table, get a curve
  2. The model
  3. Error bars that mean something
  4. Do two compounds differ?
  5. Checked against R
  6. What it does not do yet
  7. Nothing to install
  8. Try it
  9. Further reading
Two falling S-shaped curves with shaded confidence bands, fitted to scattered points: blue for bentazone, orange for glyphosate, with dotted lines down to each curve's IC50
fig. 1 — white mustard dry matter against the dose of two herbicides. Glyphosate needs about twice the dose of bentazone for the same effect (95% CI 1.6 to 2.8 times).

Give a cell, a plant or a patient more of something and the response changes, usually not in a straight line. At low doses nothing happens; then the response climbs, or falls, over a range of doses; then it levels off again. Plot the response against the logarithm of the dose and you get an S. Fitting that S is one of the most routine calculations in pharmacology, toxicology, weed science and assay development, because it gives the single number most people want: the EC50, the dose that does half the job. For a drug that inhibits something, the same number is called the IC50.

Most labs do this in GraphPad Prism, a desktop program sold on a per-user subscription. Statisticians use the free R package drc. Between them sits a large group of people who have a spreadsheet of numbers, need one curve and an EC50 with an error bar, and have neither a Prism licence to hand nor the time to learn R. The app described here, dose, is for them. Open it, click Two herbicides, and the figure above appears.

Paste a table, get a curve

The input is what is already in the spreadsheet: doses down the first column, responses in the columns beside it. Columns with the same heading are replicates of one curve, so a plate with three replicates of two compounds is six columns with two headings. Blank cells are fine, and a dose of zero, the untreated control, is drawn at the left of a broken axis rather than thrown away. The fit updates as you type.

Out comes a figure, with the data or means and standard deviations, the fitted curves, shaded 95% confidence bands and the EC50 marked, and a table: bottom, top, EC50 and Hill slope for each curve, with standard errors and confidence intervals. Both download, the figure as SVG for a paper and the table as CSV.

Everything happens in the page. The fitting engine is compiled to WebAssembly and runs on your machine, so unpublished data, or data under an agreement that forbids uploading it, never goes anywhere.

The model

The curve is the four-parameter logistic, in the form Prism uses:

y = Bottom + (Top − Bottom) / (1 + 10(log EC50 − log x) · Hill)(1)

Bottom and Top are the two plateaus. The EC50 is the dose halfway between them. The Hill slope sets how steep the S is, positive for rising curves and negative for falling ones. It is the same curve as drc’s LL.4 model with the signs of the slope swapped, which is what makes a direct comparison with drc possible.

Some curves bend more sharply at one end than the other. For those there is a five-parameter version, which adds an asymmetry factor as a power on the denominator. The app still reports the true halfway dose as the EC50, not the curve’s inflection point, which in the asymmetric model is a different thing and an easy one to misreport.

When the data never reach a plateau, it can be fixed, for example at 0 and 100 for responses already normalised to controls. Any parameter can also be shared between curves, so two compounds tested on the same plate can share a top while each keeps its own EC50.

Error bars that mean something

Fitting is by least squares, using the Levenberg–Marquardt method from several starting slopes, keeping the best. Every replicate counts as its own point. Averaging replicates before fitting, which is common, throws away the information about how noisy the data are.

The standard errors come from the curvature of the sum of squares at the best fit. The confidence interval for the EC50 is worked out on the log scale and then converted back, so it is lopsided, wider above the EC50 than below. A symmetric interval like 30 ± 25 is a sign of a calculation done on the wrong scale, and can even dip below zero.

A fitted number is only useful if you know when not to trust it, so the app says so. It warns when the EC50 lies outside the doses tested, when its interval spans more than a hundredfold, when a plateau is fitted beyond anything the data reached, and when the fit has not settled. These are the usual ways a curve fit produces a confident-looking number from data that cannot support it.

Do two compounds differ?

The question behind most dose-response experiments is a comparison: is the new compound more potent than the old one, did the mutation shift the curve? The app answers it with the extra-sum-of-squares F test. It fits the curves twice, once with separate EC50s and once with a single EC50 shared between them. If sharing makes the fit worse by more than chance would, the EC50s differ. The same test asks whether the slopes differ, and whether one curve would do for all the data.

For the two herbicides above, the EC50s differ (F = 19.6 on 1 and 60 degrees of freedom, p < 0.0001), the slopes show no clear evidence of a difference (p = 0.07), and glyphosate needs 2.12 times the dose of bentazone for the same effect, with a 95% confidence interval of 1.63 to 2.76. The Five curves example does the same for five spinach photosynthesis experiments at once, and puts diuron at about nine times the potency of bentazon.

Checked against R

A curve fitter that gives slightly wrong numbers is worse than none, so the engine is tested against independent answers, not just against itself:

  • the drc package’s published fits of two classic datasets, ryegrass root length and white mustard dry matter, are matched to five or six significant figures, with the standard errors to four;
  • the US National Institute of Standards and Technology’s Rat43 problem, a deliberately awkward sigmoid fit rated higher difficulty, is solved to its certified values from both of its official starting points;
  • the t and F distributions, written from scratch, agree with SciPy to nine digits.

The scripts that produce the reference numbers are in the repository, so the checks can be rerun.

One difference from Prism is worth knowing. When several curves are fitted together, the scatter is pooled into one residual variance across all of them, as drc does. That is what makes the comparisons possible, but on multi-curve data the standard errors can differ slightly from Prism’s default, which fits unshared curves separately.

What it does not do yet

The confidence intervals are the standard asymptotic kind, the same as Prism’s default. Profile-likelihood intervals, more accurate when the EC50 is poorly pinned down, would be a good addition. Weighting, for example by 1/y² when the noise grows with the response, outlier handling, normalising to controls inside the app, and reading Excel files directly are not there yet.

Nothing to install

The engine is about 450 lines of Rust, and the whole app, page and engine together, is 100 KB, smaller than many single photos on a web page. It is written from the published methods and shares no code with Prism or drc.

Try it

Open dose. Start with Ryegrass for a single curve, then Two herbicides, then paste your own. How it works, on the page, has the details.

Further reading