Divergence & Curl Calculator
Introduction: Divergence and Curl in a 3D Vector Field
This divergence and curl calculator evaluates how a three-dimensional vector field behaves at a single point. Divergence tells you whether the field is spreading outward or converging inward there, while curl tells you whether it has a local tendency to rotate around an axis. Together they provide a compact snapshot of source-like behavior, sink-like behavior, and swirling motion, which is why they show up so often in fluid mechanics, electromagnetism, and multivariable calculus.
You can think of a vector field F(x, y, z) as assigning a vector to every point in space, such as the velocity of a fluid, the flow of heat, or an electric or magnetic field. In this calculator, the field is written in Cartesian coordinates and split into its three components:
F(x, y, z) = (Fx(x, y, z), Fy(x, y, z), Fz(x, y, z))
Because the calculator differentiates the expressions symbolically before substituting the chosen point, the result reflects the local structure of your formulas rather than a rough finite-difference estimate.
Formulas for Divergence and Curl in Cartesian Coordinates
This calculator uses the standard partial-derivative formulas for divergence and curl in a Cartesian field, so the way you write each component directly controls what the derivative step sees.
Divergence ∇·F
For the divergence calculation, the tool adds the derivative of each component with respect to its matching coordinate: x for Fx, y for Fy, and z for Fz. That is what makes divergence a measure of local expansion or contraction around the chosen point.
∇·F = ∂Fx/∂x + ∂Fy/∂y + ∂Fz/∂z
The result panel reports this scalar at your evaluation point, so you can read it as a source-like value, a sink-like value, or a neutral balance depending on the sign.
Curl ∇×F
For curl, the calculator forms cross-derivative differences, so each component compares how one part of the field changes in a perpendicular direction. That pattern is what makes curl especially sensitive to twisting, circulation, and local spin.
∇×F = ( ∂Fz/∂y − ∂Fy/∂z, ∂Fx/∂z − ∂Fz/∂x, ∂Fy/∂x − ∂Fx/∂y )
In a physical model, the curl vector points along the axis of local rotation and its magnitude shows how strong that rotation is at the point you picked.
How to Use the Divergence & Curl Calculator on a 3D Field
To use this divergence and curl calculator, enter three expressions for the vector-field components and then choose the single point where you want the derivatives evaluated.
-
Enter the vector field components.
- In Fx(x, y, z), type the x-component, e.g.
x*y,y^2 + sin(z), or3*x. - In Fy(x, y, z), type the y-component, e.g.
y*zorcos(x). - In Fz(x, y, z), type the z-component, e.g.
z*xorx^2 + y^2.
Use
x,y, andzas the variables. Supported syntax includes standard operators (+, −, *, /, ^) and common functions likesin,cos,exp, andlog, so you can describe many textbook vector fields directly. - In Fx(x, y, z), type the x-component, e.g.
-
Specify the evaluation point.
- x0: the x-coordinate of the point, e.g.
1or0.5. - y0: the y-coordinate.
- z0: the z-coordinate.
The evaluation point tells the calculator where to substitute after differentiating, so x0, y0, and z0 should be the coordinates of the location you want to inspect.
- x0: the x-coordinate of the point, e.g.
-
Click “Evaluate”.
The tool differentiates each component symbolically with respect to x, y, and z, then substitutes the point (x0, y0, z0) to give numerical values for ∇·F and ∇×F.
Interpreting Divergence and Curl Results
When you run the divergence and curl calculator, the output gives you two different kinds of information about the same point in space: one scalar for divergence and one three-component vector for curl.
- Positive divergence: the point behaves like a source, meaning more field is flowing out than in. In a fluid picture, that is the kind of point where material seems to spread away from the location.
- Negative divergence: the point behaves like a sink, meaning more field is flowing in than out. That is the opposite of a source-like region and suggests local convergence.
- Zero divergence: the field is locally incompressible or solenoidal, so a tiny volume element is neither expanding nor shrinking at that point.
- Large curl magnitude: the field has strong local rotation or vorticity, which is what you expect near a swirling flow, a whirlpool, or any field with pronounced circulation.
- Zero curl: the field is locally irrotational. In many simply connected examples, that is the pattern associated with conservative force fields such as gravity or electrostatics.
If a result seems surprising, look back at the expressions you entered. Terms that depend on the same variable as their own component usually feed divergence, while mixed-variable terms are often what create curl.
Worked Example: A Polynomial Vector Field
This worked example for the divergence and curl calculator uses a simple polynomial field whose derivatives are easy to check by hand. It is a good test case because each component depends on a different pair of variables, so the divergence and curl isolate different kinds of variation in the field.
Consider the vector field
F(x, y, z) = (x y, y z, z x)
Step 1: Compute the divergence:
- ∂Fx/∂x = ∂(x y)/∂x = y
- ∂Fy/∂y = ∂(y z)/∂y = z
- ∂Fz/∂z = ∂(z x)/∂z = x
So
∇·F = y + z + x
Step 2: Compute the curl components:
- (∇×F)x = ∂Fz/∂y − ∂Fy/∂z = 0 − y = −y
- (∇×F)y = ∂Fx/∂z − ∂Fz/∂x = 0 − z = −z
- (∇×F)z = ∂Fy/∂x − ∂Fx/∂y = 0 − x = −x
So
∇×F = ( −y, −z, −x )
Step 3: Evaluate at the point (1, 2, 3):
- ∇·F(1, 2, 3) = 2 + 3 + 1 = 6
- ∇×F(1, 2, 3) = ( −2, −3, −1 )
Entering fx = x*y, fy = y*z, fz = z*x and x0 = 1, y0 = 2, z0 = 3 into the calculator reproduces these values exactly, which makes the example a convenient sanity check for the symbolic differentiation step.
Comparison: Divergence vs Curl in Vector-Field Analysis
This comparison helps you read the two outputs that come back from the divergence and curl calculator. Divergence collapses the field behavior at a point into a single scalar, while curl returns a vector that tells you how the field tends to twist.
| Aspect | Divergence (∇·F) | Curl (∇×F) |
|---|---|---|
| Type of quantity | Scalar (single number) | Vector (three components) |
| Geometric meaning | Net outflow or inflow from a small volume | Local rotation or swirling of the field |
| Typical interpretation in fluids | Compressibility or sources/sinks of fluid | Vorticity (how much the fluid spins) |
| Typical interpretation in electromagnetism | Related to charge density (Gauss’s law) | Related to changing fields and induction (Faraday’s law, Ampère’s law) |
| Zero value implies | Solenoidal / incompressible behavior | Irrotational field; often conservative (on simply connected domains) |
| Main operation | Sum of normal components of the derivative | Difference of mixed partial derivatives in cyclic order |
In practice, the divergence value is the first number to check when you want a source-or-sink story, while the curl vector is the one to inspect when circulation, spin, or vorticity matters more than net expansion.
Assumptions and Limitations for Divergence and Curl
- Coordinate system: This divergence and curl calculator works in 3D Cartesian coordinates only, with variables
x,y, andz. - Smoothness: The formulas assume that Fx, Fy, and Fz are differentiable near the evaluation point. Sharp corners, cusps, absolute values, or piecewise-defined fields can make the derivatives unreliable at that point.
- Symbolic differentiation: The underlying engine uses symbolic rules. If an expression has a domain issue, a non-differentiable point, or syntax the parser cannot understand, the calculator may return an error or a non-finite value.
- Single-point evaluation: This tool evaluates divergence and curl at a single point, not over a whole region. If you need streamlines, contour plots, or a full field map, you will need additional software.
- Physical modeling: A numerical answer still needs context. Units, coordinate conventions, boundary conditions, and the underlying physical law all matter when you interpret a real fluid, electromagnetic, or continuum-mechanics problem.
Related Vector Calculus Concepts for Divergence and Curl
Divergence and curl sit alongside other core operators in vector calculus, and they are easiest to understand when you compare them with the tools that transform or measure fields in different ways.
- Gradient: Takes a scalar field, such as temperature or pressure, and returns a vector field pointing in the direction of greatest increase. When you understand gradients, it becomes easier to see how divergence and curl describe different derivative patterns in a vector field.
- Line integrals: Integrate a vector field along a curve, which is useful for work, circulation, and transport problems where the path itself matters.
- Flux integrals: Integrate the normal component of a vector field across a surface. This is closely related to divergence through the divergence theorem and is useful when you want to measure flow through a boundary.
Using this divergence and curl calculator alongside gradient or flux tools can help build intuition for Maxwell’s equations, fluid flow problems, and the way local derivative information describes a field’s behavior at a point.
Arcade Mini-Game: Divergence & Curl Calculator Calibration Run
Use this quick arcade run to practice separating the vector-field components from the evaluation point before you trust the divergence and curl output.
Start the game, then use your pointer or arrow keys to catch useful field inputs and avoid bad assumptions about the derivatives.
