Vector Calculator
Perform vector operations including addition, subtraction, scalar multiplication, dot product, cross product, and projection. Supports both 2D and 3D vectors.
Vector Arithmetic
Add, subtract vectors or multiply by a scalar
How to Use the Vector Calculator
Select 2D or 3D mode, choose an operation type, enter your vector components, and click Calculate. Results include the computed vector and related properties.
Calculator Modes
Vector Arithmetic
Perform basic operations on vectors:
- Addition (A + B): Add corresponding components
- Subtraction (A - B): Subtract corresponding components
- Scalar Multiplication (k × A): Multiply each component by a scalar
Vector Properties
Calculate important properties of a single vector:
- Magnitude (|v|): The length of the vector: √(x² + y² + z²)
- Unit Vector: A vector of length 1 in the same direction: v/|v|
Dot & Cross Products
Calculate products between two vectors:
- Dot Product (A · B): A scalar equal to |A||B|cos(θ). Result is a number.
- Cross Product (A × B): A vector perpendicular to both A and B (3D only)
- Angle: The angle between the two vectors in degrees
Vector Projection
Project vector A onto vector B. The projection is the component of A that lies along the direction of B. Formula: proj_B(A) = (A · B / |B|²) × B
What is a Vector?
A vector is a quantity with both magnitude (size) and direction. Vectors are represented as ordered lists of numbers called components. In 2D: (x, y), in 3D: (x, y, z).
Common Applications
- Physics (force, velocity, acceleration)
- Computer graphics and game development
- Engineering calculations
- Machine learning and data science
- Navigation and GPS systems
Key Formulas
- Magnitude: |v| = √(x² + y² + z²)
- Dot Product: A · B = a₁b₁ + a₂b₂ + a₃b₃
- Cross Product: A × B = (a₂b₃ - a₃b₂, a₃b₁ - a₁b₃, a₁b₂ - a₂b₁)
Worked Example: Angle Between Two Vectors
Take A = (3, 4) and B = (4, 3). The dot product is 3×4 + 4×3 = 24, and both magnitudes are √(9 + 16) = 5. So cos(θ) = 24 / (5 × 5) = 0.96, giving θ ≈ 16.26°. A dot product of zero would mean the vectors are perpendicular, while a negative value means the angle between them exceeds 90°.
Frequently Asked Questions
What is the difference between the dot product and the cross product?+
The dot product returns a single number (a scalar) equal to |A||B|cos(θ) and measures how much two vectors point in the same direction. The cross product, defined only in 3D, returns a new vector perpendicular to both inputs whose length equals the area of the parallelogram they span. Use the dot product for angles and projections, and the cross product for normals and torque.
How do I find the magnitude and unit vector of a vector?+
The magnitude is the square root of the sum of squared components: for (3, 4) it is √(9 + 16) = 5. The unit vector divides each component by that magnitude, giving (0.6, 0.8) — same direction, length exactly 1. Enter your components in Properties mode and the calculator returns both.
Why can I not compute a cross product for 2D vectors?+
The cross product is only defined in three dimensions, because it must produce a vector perpendicular to both inputs — in 2D no such in-plane vector exists. If you have 2D vectors, treat them as 3D with z = 0; the cross product then points entirely along the z-axis and its z-component equals the signed parallelogram area.
What does vector projection tell me?+
The projection of A onto B is the component of A that lies along B's direction, computed as (A · B / |B|²) × B. In physics this decomposes a force into parts parallel and perpendicular to a surface; in graphics it is used for shadows and collision responses. The calculator returns both the projection vector and its scalar length.
Is this vector calculator free and does it run in the browser?+
Yes. It is completely free with no sign-up, and every operation — addition, dot and cross products, projection — is computed locally in your browser, so nothing is sent to a server. It works on mobile and desktop, making it useful for physics homework and quick game-development checks.
Related Tools
Matrix Calculator
Add, subtract, multiply matrices. Calculate determinant, transpose, and inverse for 2x2 and 3x3 matrices.
Complex Number Calculator
Perform arithmetic on complex numbers, convert forms, calculate powers and roots.
Triangle Calculator
Calculate triangle properties including area, perimeter, angles, and sides
Force Calculator
Calculate force, mass, and acceleration using Newton's second law (F=ma) with advanced physics formulas.
Velocity Calculator
Calculate velocity, speed, and kinematics with unit conversions and relative velocity.
Momentum Calculator
Calculate momentum (p=mv), impulse, and collision outcomes. Includes elastic and inelastic collision calculations.