What is a Divergence Calculator?
The Divergence Calculator is a free online tool that finds the divergence of a vector field at a point — a single number that says whether the field is spreading out from that point or flowing into it. Vector-calculus, electromagnetism and fluid-mechanics students use it when to tell a source from a sink in a field, for example whether charge is piling up or draining away at a point. Instead of differentiating three components and adding them, where the partial derivatives are easy to mix up, you type the vector field from the list and the point (x, y, z) to evaluate at and the calculator returns the divergence, plus the three partial derivatives that add up to it straight away.
The working idea is simple. the calculator differentiates each component with respect to its own variable — P with respect to x, Q with respect to y, R with respect to z — and adds the three results Each partial derivative is a central finite difference with step 0.00001, so the answer is a numeric approximation accurate to about four decimal places for the smooth fields on the list. There is no sign-up and nothing to install: the page runs entirely in your browser, so your numbers never leave your device.
That matters because divergence is the local measure of outflow: positive means the field spreads out like water from a tap, negative means it converges like water down a drain, and zero means as much flows in as out The derivatives are numeric approximations from finite differences, not symbolic results, so they are accurate to roughly four decimal places for smooth fields. The rest of this page walks through the formula, the input people get wrong most often, and a worked example with real numbers you can check by hand.
How a Divergence Calculator works
At its core, the calculator applies the divergence is the sum of the three partial derivatives, one per component. div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z, where F = (P, Q, R). Each term measures how fast its component grows along its own axis, and the sum measures the net outflow per unit volume at the point. The formula box at the top of this page shows the same rule in symbols: div F = ∂P/∂x + ∂Q/∂y + ∂R/∂z (each partial by central finite differences).
The calculator evaluates each component a tiny step ahead and behind along its own axis and divides by twice the step. The three partials are shown separately, so you can see which component is doing the spreading. For the field (y, −x, 0) the divergence is exactly 0 everywhere, because P = y does not depend on x and Q = −x does not depend on y — a rotating field spreads nothing. That is a good test case, not a broken result.
Central differences with h = 0.00001 give about four correct decimal places on smooth fields A derivative calculator can help you check the numbers that feed into this step, and it is worth doing that check before you trust an answer that looks surprising.
The calculator does the arithmetic, but the judgement stays with you: check that the inputs are the ones the problem states, that the units match, and that the answer is in the range you expect before you use it anywhere else. A result that surprises you is usually a mistyped input, not a broken formula.
The the vector field explained
The field is the whole problem, and the mistake people make is picking a similar-looking one from the list. The field (x², y², z²) spreads outward everywhere, while (y, −x, 0) is a pure rotation with zero divergence everywhere — and the two give completely different answers at the same point. Read the components slowly and match each one to your problem before you enter the point.
Write your field as (P, Q, R) and compare it component by component with the list. If your field is (xy, yz, zx), pick that entry; if it is not on the list, pick the closest one and treat the answer as a guide. Check the three partial derivatives shown: for F = (x², y², z²) they should be 2x, 2y and 2z, so at (1, 2, 3) they are 2, 4 and 6, adding to 12.
A divergence of 0 does not mean the field is zero — a rotating field can be strong everywhere and still diverge to nothing. Check the field itself, not just the answer. A trigonometry calculator is a good cross-check when the input comes from a measurement or a table rather than from a textbook problem.
A worked example
Take the default settings on this page: F = (x², y², z²) at the point (1, 2, 3).
The partials are ∂P/∂x = 2x = 2, ∂Q/∂y = 2y = 4 and ∂R/∂z = 2z = 6. Adding them gives a divergence of 12.
A divergence of 12 is strongly positive, so the field is spreading out fast at this point — like the flow away from a source. The z-component contributes the most, 6 out of 12, because z is the largest coordinate. At the origin the same field has divergence 0, because all three partials are zero there. The field is calm at the centre and spreads faster as you move away.
You can check the arithmetic above with a pocket calculator: take the inputs, apply the formula step by step, and compare each intermediate value with the one shown. If a step disagrees, the input that feeds it is usually the cause — a mistyped digit, a wrong unit, or a value entered in the wrong box.
Where the Divergence Calculator is used
In electromagnetism, the divergence of the electric field at a point is proportional to the charge density there — Gauss's law in differential form — so this calculation is how you find charge from a field, and vice versa.
In fluid mechanics, the divergence of a velocity field says whether fluid is being created or destroyed at a point. An incompressible flow has zero divergence everywhere, which is a condition engineers check in simulations. A scientific calculator often sits next to it in the same workflow, because the two answers answer different halves of the same question.
In heat flow, the divergence of the heat-flux field says whether a point is heating up or cooling down, which is the starting point for the heat equation.
It also helps to keep the units consistent from the first number to the last. Mixing units — metres with centimetres, degrees with radians, seconds with minutes — is the quietest way to get an answer that looks plausible and is wrong by a large factor. Write the unit next to every number you enter, and check the result's unit against the unit you expect before you use the answer anywhere else.
Divergence Calculator vs Derivative Calculator
A derivative calculator differentiates one function of one variable. This calculator differentiates three functions of three variables and adds the results. The divergence is built from partial derivatives, so it is one step up in machinery — but the idea is the same: a rate of change, measured at a point.
Use the derivative calculator for a single curve, and this one when the question is about a field in space. If your problem has a vector field, the one-variable tool cannot state it. The slope calculator covers the other side of the same problem, so the two tools complement each other rather than compete.
The two agree where they overlap: each partial derivative inside the divergence is an ordinary derivative of one component with respect to one variable, with the other variables held fixed.
Common mistakes with the Divergence Calculator
The first mistake is differentiating each component with respect to the wrong variable — ∂P/∂y instead of ∂P/∂x. Divergence always pairs P with x, Q with y and R with z; any other pairing is a different quantity.
The second mistake is reading a positive divergence as a large field. Divergence measures change, not size: a huge field that is the same everywhere has zero divergence, and a small field that grows quickly can have a large one.
The third mistake is forgetting the units. Divergence has units of the field divided by length, so for a velocity field it is per second — a rate, not a speed — and comparing it with a speed directly is meaningless.
A last mistake is trusting the first answer without a rough check. Before you accept a result, estimate it by hand to one significant figure: if the calculator says 400 and your rough estimate says 40, something is off — usually a misplaced decimal point or a wrong unit. The calculator does the arithmetic; the judgement about whether the answer makes sense still belongs to you.
How to use this Divergence Calculator
Open the page and enter the vector field from the list and the point (x, y, z) to evaluate at. Pick the field, enter the point, and read the divergence first, then the three partials that add up to it. The partials are the check that the field was read correctly.
Read a positive divergence as outflow — a source — and a negative one as inflow — a sink. Zero means the flow is balanced at that point. Read the three partials to see which direction is doing the spreading: the biggest one is the axis along which the field grows fastest.
Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. If a result looks wrong, re-check the inputs first: a single mistyped number is the usual cause, and a derivative calculator will confirm the arithmetic.