2D and 3D vectorsReviewed 28 Sep 2026Runs in your browser

Vector Calculator

Add and subtract vectors, find the magnitude, unit vector, dot product, cross product, angle between two vectors and the projection of one onto another — in 2D or 3D, with the determinant working shown.

Who wrote it

Written by Suhaib Hassan. Every formula is standard vector algebra, and the worked examples are re-derived by hand. Our methodology.

How the engine works

It combines components directly: sums of products for the dot product, a 3×3 determinant for the cross product, and arccos of the normalised dot product for the angle.

Why we built it

Physics and graphics use these operations constantly. Seeing the vectors drawn and the algebra written out makes sign and order errors easy to spot.

Operations on u and v

Space
Presets
Vector u|u| = —
x
y
z
Vector v|v| = —
x
y
z
Live expansion—
Dot product (u · v)—
—

—

Angle between u and v—
Cross product (u × v)—

Vector diagram

Vectors drawn from the origin; 3D vectors use an oblique projection.

—

Step-by-step working

—

—

    Vector operations at a glance

    What each product returns and what it means.

    OperationNotationResultDimensionsMeaning
    Dot productu · vScalarAny (2D, 3D, n-D)Work done; how aligned two vectors are
    Cross productu × vVector3D (and 7D)Torque, angular momentum, surface normals
    Scalar projectioncompv uScalarAnyLength of u’s shadow along v
    Vector projectionprojv uVectorAnyThe part of u parallel to v
    Scalar triple productu · (v × w)Scalar3DSigned volume of a parallelepiped

    Worked examples

    Work done by a force

    A force F = (10, 0, 5) N moves an object by d = (3, 4, 0) m.

    W = F · d = 10·3 + 0·4 + 5·0 = 30 J

    Torque on a wrench

    Position r = (0.5, 0, 0) m, force F = (0, 20, 0) N.

    τ = r × F = (0·0 − 0·20, 0·0 − 0.5·0, 0.5·20 − 0·0)
    = (0, 0, 10) N·m

    Angle between vectors

    u = (3, 4, 0) and v = (1, 2, 2).

    u·v = 11, |u| = 5, |v| = 3
    cos θ = 11 ÷ 15 = 0.7333
    θ = 42.8334°

    What is a vector?

    A vector has both magnitude and direction and is written by its components, such as u = (3, 4, 0). Its magnitude is |u| = √(uₓ² + u_y² + u_z²), and dividing by it gives the unit vector û = u ÷ |u|, of length 1.

    Formulas used

    • Dot product: u · v = uₓvₓ + u_yv_y + u_zv_z = |u||v| cos θ.
    • Angle: θ = arccos[(u · v) ÷ (|u||v|)], between 0° and 180°.
    • Cross product: u × v = (u_yv_z − u_zv_y, u_zvₓ − uₓv_z, uₓv_y − u_yvₓ); its length |u||v| sin θ is the area of the parallelogram they span.
    • Projection: projv u = [(u · v) ÷ |v|²] v and compv u = (u · v) ÷ |v|.

    By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →

    Sources

    • Gibbs, J. W. & Wilson, E. B. (1901). Vector Analysis. Yale University Press.
    • ISO 80000-2:2019, Quantities and units — Part 2: Mathematics — notation for vectors and their products.

    Frequently asked questions

    Why is the dot product a scalar but the cross product a vector?

    The dot product measures how much two vectors point the same way, which is a single number. The cross product produces a new vector perpendicular to both, whose length is the area of the parallelogram they span. In 2D there is no perpendicular direction within the plane, so the cross product reduces to one number (the z-component).

    What does a zero dot product mean?

    The vectors are perpendicular (orthogonal), provided neither is the zero vector, because cos 90° = 0. A negative dot product means the angle is obtuse; a positive one means it is acute.

    What does a zero cross product mean?

    The vectors are parallel or antiparallel (or one is zero), because sin 0° = sin 180° = 0. They span no area.

    How does the right-hand rule fix the direction of the cross product?

    Point the fingers of your right hand along u, curl them toward v, and your thumb points along u × v. Reversing the order reverses the direction: v × u = −(u × v).

    What is the difference between scalar and vector projection?

    The scalar projection is the signed length of u’s shadow along v. The vector projection is that length pointing along v’s direction. The difference u − projv u is the part of u perpendicular to v.

    Why does the cross product only exist in 3D?

    The construction needs a unique direction perpendicular to two given directions, which exists only in three dimensions (and, with a different algebra, in seven). In other dimensions the wedge product generalises it.

    Related calculators

    Continue with geometry.

    All Math Calculators

    Embed This Vector Calculator

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/vector-calculator.html" width="100%" height="560" loading="lazy" title="Vector Calculator"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution