Solved.tools — Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Work Calculator

Last updated: 10 August 2026

Reviewed by Gavin · Research and drafting assisted by AI

Calculate mechanical work done by a force acting on an object. Choose a constant force with W = F · d · cos θ, a variable force integrated as W = ∫ F(x) dx for a polynomial force law, or an ideal linear spring withW = ½ · k · (x₁² − x₀²). All results are in joules (J = N · m).

Mode:
Quick presets:
Was this helpful?


Work Calculator

A work calculator computes the mechanical work done by a force acting on an object, supporting the three formulations you actually meet in an introductory physics course: a constant force acting along a straight line, a variable force that varies with position and must be integrated, and an ideal linear spring that obeys Hooke's law. The result is reported in joules (J), the SI unit of energy, where 1 J = 1 N · m. Work is a scalar quantity that describes the energy transferred to or removed from an object by a force; whether the transfer is positive or negative depends on the geometric relationship between the force and the displacement, and on whether the force increases or decreases in magnitude along the path.

The constant-force formula W = F · d · cos θ is the most familiar version and the one most textbooks introduce first. The variable-force version W = ∫F(x) dx generalises the same idea to any force law that can be integrated analytically, and the spring formula W = ½ · k · (x₁² − x₀²) is a special case where the force grows linearly with displacement. Knowing when each formula applies, and how to convert between them, is essential for any problem in mechanics, biomechanics, machine design, or thermodynamics that involves an object changing speed or storing elastic energy.

How to Use the Work Calculator

  1. Select the solve mode that matches your problem: Constant force for W = F · d · cos θ, Variable force for W = ∫F(x) dx over a polynomial F(x), or Spring for W = ½ · k · (x₁² − x₀²).
  2. Enter the required input values. For constant force you need force magnitude, displacement magnitude, and the angle between them; the calculator accepts the angle in either degrees or radians. For variable force you need the polynomial coefficients a, b, c, d in F(x) = a + b·x + c·x² + d·x³ and the lower and upper integration limits x₀ and x₁. For spring you need the spring constant k, the starting displacement x₀, and the ending displacement x₁.
  3. Click Calculate to see the work in joules together with the substituted formula and any intermediate quantities (cos θ, the antiderivative at each endpoint, the change in elastic potential energy).
  4. If you are unsure what values to enter, click any of the preset buttons to load a textbook example with a known answer, then change the inputs and re-calculate to see how the result responds.

The calculator does all arithmetic in the browser using standard IEEE-754 double-precision floating point, so results are accurate to roughly 15 significant digits for inputs near unity. For very large forces or displacements (above 1×10⁹ in magnitude) the calculator switches to exponential notation automatically to preserve precision.

The Formulae

Constant force along a straight line:

W = F · d · cos θ

where W is work in joules, F is the magnitude of the constant force in newtons, d is the magnitude of the displacement in metres, and θ is the angle between the force vector and the displacement vector in degrees or radians. The cosine term is the projection of the force onto the displacement direction, geometrically, the component of F that points along d.

Variable force integrated along a straight line:

W = ∫[x₀ → x₁] F(x) dx

For the supported case where F(x) is a polynomial up to cubic, F(x) = a + b·x + c·x² + d·x³, the antiderivative is G(x) = a·x + b·x²/2 + c·x³/3 + d·x⁴/4, and the work is simply W = G(x₁) − G(x₀). The same approach generalises to any force law whose antiderivative you can write down; for forces that resist or assist the motion (like air drag or spring tension) the integrand changes sign accordingly.

Ideal linear spring (Hooke's law):

W = ½ · k · (x₁² − x₀²)

where k is the spring constant in newtons per metre (N/m) and x₀ and x₁ are the starting and ending displacements from the spring's natural length in metres. This is exactly the integral of F = k·x from x₀ to x₁, so it is a special case of the variable-force formula when the force is linear in x.

Sign convention: positive work means the force component along the displacement does energy to the object (the object gains kinetic energy or stored elastic energy); negative work means the force component opposes the motion and removes energy from the object (friction, air drag, the restoring force of a spring as it pushes back to its natural length).

Real-World Worked Examples

Example 1, Pulling a sled at an angle

A child pulls a sled with a force of 10 N applied through a rope at 60° above the horizontal. The sled moves 4 m across flat ground.

W = F · d · cos θ
  = 10 × 4 × cos(60°)
  = 10 × 4 × 0.5
  = 20 J

The vertical component of the pull (10 · sin 60° ≈ 8.66 N) does no work because the sled moves horizontally, only the horizontal component, F · cos θ = 5 N, contributes. If the rope were horizontal (θ = 0°) the same pull would do 40 J of work; if the rope were vertical (θ = 90°) the same force would do zero work regardless of how far the child walked.

Example 2, Braking force on a bicycle

A bicycle rider applies the brakes with a constant friction force of 80 N opposing the motion. The bicycle rolls 6 m before stopping.

W = F · d · cos θ
  = 80 × 6 × cos(180°)
  = 80 × 6 × (-1)
  = -480 J

The negative sign reflects that the braking force points opposite to the direction of motion. The kinetic energy of the rider-and-bike system must decrease by 480 J over the 6 m stopping distance, which is consistent with a final speed of about 12 m/s for a 70 kg system if you work it through the work-energy theorem.

Example 3, Stretching a spring from rest

A linear spring with constant k = 100 N/m is stretched from its natural length (x₀ = 0) to x₁ = 0.5 m.

W = ½ · k · (x₁² − x₀²)
  = ½ × 100 × (0.5² − 0²)
  = ½ × 100 × 0.25
  = 12.5 J

12.5 J of work has been stored as elastic potential energy in the spring. If the spring is released, that 12.5 J is converted into kinetic energy of whatever is attached to the end of the spring. Compare to the same spring stretched only to x₁ = 0.1 m, which stores only 0.5 J, the quadratic dependence on displacement is why springs become much harder to stretch the further they are already stretched.

Example 4, Spring starting partway compressed

A spring with k = 200 N/m starts compressed by 0.2 m and is further compressed to 0.5 m.

W = ½ · k · (x₁² − x₀²)
  = ½ × 200 × (0.5² − 0.2²)
  = ½ × 200 × (0.25 − 0.04)
  = ½ × 200 × 0.21
  = 21 J

The extra 21 J of work went into the spring beyond what was already stored at the start. The total stored energy at the end is ½ × 200 × 0.5² = 25 J, and the spring already held ½ × 200 × 0.2² = 4 J at the start, so the change in stored energy is exactly 25 − 4 = 21 J.

Example 5, Linear variable force

A position-dependent force F(x) = 5x (in newtons, with x in metres) acts on an object as it moves from x = 0 to x = 4 m.

W = ∫[0 → 4] 5x dx
  = [5x² / 2] from 0 to 4
  = 5 × 4² / 2 − 5 × 0² / 2
  = 40 − 0
  = 40 J

Compare to a constant 10 N force acting over the same 4 m distance, which would do 40 J as well, in this particular case the average force equals the constant-force equivalent, so the work matches. For a quadratic force F(x) = 3x² over 0 to 2 m, the average force is 3 × 1² = 3 N (the mean of the integrand at the midpoint) and the work is 3 × 2 = 6 J, but the exact integral gives 8 J, illustrating that the "force × distance" heuristic only works for constant forces.

Common Mistakes When Using the Work Formula

Mistake 1: Forgetting the cosine of the angle. The most common error is computing W = F · d and ignoring the angle. A force of 100 N applied at 30° to a 10 m displacement does only 866 J of work, not 1000 J. Always check whether the force points along the displacement, against it, or somewhere in between.

Mistake 2: Mixing up work and force. Work and force are different physical quantities with different units. Force is measured in newtons; work is measured in joules. They are related by displacement, but you cannot "calculate work from force alone", you always need the displacement and (for general orientations) the angle.

Mistake 3: Using the spring formula for non-linear springs. The equation W = ½ · k · (x₁² − x₀²) only applies when the spring obeys Hooke's law, force proportional to displacement. Real springs deviate from Hooke's law well before they yield; for those regimes you must integrate the actual force-displacement curve numerically or use a more sophisticated material model.

Mistake 4: Treating path-dependence as irrelevant. Work done by a conservative force (gravity, spring) depends only on the start and end positions. Work done by friction or air drag depends on the path taken, a longer route dissipates more energy even if the start and end points are the same. Always ask whether the force in your problem is conservative before assuming the spring-style formula applies.

Mistake 5: Sign confusion. Positive work means energy was added to the object (it sped up, or stored energy); negative work means energy was removed (it slowed down, or released stored energy). The same force can do positive work on one object and negative work on another if they move in opposite directions, a tug-of-war rope is a classic example where the work done by the tension is positive on one side and negative on the other.

When to Use Which Work Formula

The three modes in the calculator map directly to the three most common textbook problems:

FormulaBest For
W = F · d · cos θConstant forces, one-step kinematics, friction problems, tension in ropes, applied forces at known angles
W = ∫F(x) dxPosition-dependent forces: linear springs (alternative form), gravitational work over large distances where g varies, electromagnetic forces on charged particles in non-uniform fields
W = ½ · k · (x₁² − x₀²)Ideal linear springs, elastic potential energy stored or released, mechanical energy conservation problems

For more complex problems, variable forces that are not easily integrable, forces that change direction during the motion, or systems with multiple forces acting simultaneously, break the problem into segments where each segment uses one of these three formulas, and sum the works.

What Work Tells You About a System

Work is the bridge between force and energy. The work-energy theorem states that the net work done on an object equals its change in kinetic energy: W_net = ½mv₁² − ½mv₀². This single equation is the starting point for nearly every dynamics problem: figure out the forces, integrate to find the net work, set that equal to the change in kinetic energy, and solve for the unknown velocity or distance.

For conservative forces (gravity, springs), work also equals the negative change in potential energy: W = −ΔU. This lets you track mechanical energy as it converts between kinetic and potential forms without ever computing the intermediate forces. The spring formula W = ½ · k · (x₁² − x₀²) is the spring's expression of this: the work done against the spring force as it stretches equals the increase in its stored elastic potential energy.

In thermodynamics and engine design, work is one of the two ways energy crosses a system boundary (the other being heat). A gas expanding against a piston does work on the piston; a chemical reaction in a closed container does not. The sign of the work tells you whether energy enters or leaves the system, and the magnitude tells you how much.

Frequently Asked Questions

What is the difference between work and energy?

Work and energy are both measured in joules, but they describe different things. Energy is a property of an object or system (kinetic energy, potential energy, thermal energy, and so on). Work is the transfer of energy caused by a force acting through a displacement. You can think of work as the act of moving energy around: when a force does positive work on an object, the object's kinetic or potential energy increases by that amount; when a force does negative work, the object's energy decreases. Energy is a state variable; work is a process variable.

Can work be negative?

Yes. Work is negative whenever the force component along the displacement is opposite to the displacement. The classic example is friction: the friction force always points opposite to the motion, so it always does negative work on a sliding object, removing kinetic energy. A spring doing work back on an object as it returns to its natural length also does negative work on whatever is stretching it. In any calculation involving multiple forces, only the net work, the sum of all positive and negative contributions, determines the change in kinetic energy.

How do you find work from a force vs position graph?

Plot F(x) along the vertical axis and x along the horizontal axis; the area under the curve between x₀ and x₁ equals the work W. This is the graphical interpretation of the integral W = ∫F(x) dx. For piecewise-linear force graphs, you can break the area into triangles and rectangles; for smooth curves you can use the geometric area formula or numerical integration. This graphical method is especially useful when the force law is empirical, measured in the lab rather than written as an equation, because you can read the work directly from the graph without fitting a function.

Why is the spring work formula quadratic in x?

The spring force grows linearly with displacement (F = kx), but work is the integral of force over displacement. Integrating a linear function gives a quadratic result, which is why W = ½ · k · x² for a spring starting at its natural length. The factor of ½ comes directly from the integral ∫x dx = x²/2. Doubling the displacement quadruples the stored energy, which is why over-stretching a spring quickly reaches its elastic limit: the energy density scales as the square of the strain.

Does the work done by gravity depend on the path?

No. Gravity is a conservative force, so the work done by gravity on an object moving from one point to another depends only on the vertical displacement between those points, not on the path taken. A 1 kg object lifted 10 m straight up gains 98.07 J of gravitational potential energy whether you lift it vertically, slide it up a frictionless ramp, or carry it along a winding staircase. This path-independence is what makes gravitational potential energy a well-defined quantity in the first place. Friction is the opposite: it is non-conservative, and the work it does depends on the length of the path.

How is work related to power?

Power is the rate at which work is done. If a force does W joules of work in t seconds, the average power is P = W / t in watts (1 W = 1 J/s). For an engine or motor delivering a steady power P, the total work in time t is W = P · t. A 100 W light bulb, for instance, does 100 J of work (well, emits 100 J of light and heat) every second. Peak power is the maximum instantaneous rate, often many times higher than the average for short bursts like a sprinter's leg muscles or a car engine accelerating from rest.


Also try these free tools: