Add, subtract, scale, dot, cross, magnitude, angle, unit vector and projection for 2D and 3D vectors — browser-only
- Runs locally
- Category Calculator
- Best for Getting a realistic range before a purchase, plan, workout, or schedule decision.
Enter two vectors as comma-separated components (2D or 3D). Pick an operation and read the result. Cross product needs 3D; angle and projection need a non-zero second vector. Everything runs in your browser.
What this tool does
A focused vector calculator for 2D and 3D vectors that does the operations a physics or linear-algebra course actually asks for. Type each vector as comma-separated components and pick an operation: vector addition and subtraction, scalar multiplication, the dot product (a scalar), the cross product (a 3D vector, with the 2D case shown as the signed z-component), magnitude with the square-root-of-sum-of-squares formula, the angle between two vectors in degrees from the cosine rule, unit vectors, and the projection of one vector onto another. A single vector is enough for magnitude and normalisation. The cosine value is clamped to keep the angle stable against floating-point noise, and zero-vector cases are reported instead of returning a misleading NaN. One-click copy and a shareable URL that reopens with your exact vectors and operation. Everything runs in your browser; no numbers are uploaded.
Tool details
- Input
- Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 9 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Calculator · Student
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Vector Calculator fits into your work
Use it for fast estimates, comparisons, and planning numbers before you make the final call.
Calculation jobs
- Getting a realistic range before a purchase, plan, workout, or schedule decision.
- Comparing scenarios by changing one input at a time.
- Turning rough assumptions into a number you can discuss.
Calculation checks
- Double-check units, dates, rates, and rounding assumptions.
- Treat health, finance, tax, and legal outputs as planning aids, not professional advice.
- Save the inputs that produced an important result so you can reproduce it later.
Good next steps
These links move the current task into a more complete workflow.
- 1 Scientific Calculator Scientific calculator — sin / cos / log / sqrt / power, with full keyboard input + history, deg/rad mode. Open
- 2 Matrix Calculator Matrix calculator — add/sub/multiply/inverse/determinant/transpose/rank/RREF/eigenvalues for n×m matrices, step-by-step. Open
- 3 Unit Converter Convert between length, weight, temperature, area, volume, speed, time — instant, browser-only Open
Real-world use cases
Check physics homework on forces and motion
A statics problem gives two force vectors and asks for the resultant and the angle between them. Type both forces as components, read the sum directly, then switch to the angle operation to confirm θ. When the dot product comes back as 0 you know instantly the two forces are perpendicular, which is often the whole point of the question. No re-deriving the cosine rule by hand under exam pressure.
Compute a surface normal in a graphics or game project
You have two edge vectors of a triangle and need the normal for lighting. Take the cross product of the two edges to get a perpendicular vector, then normalise it to length 1 so the shading math behaves. Paste both edges as 3D components, run cross product, switch to the unit-vector operation, and copy the three numbers straight into your shader uniform.
Decompose a vector for an engineering calculation
Projecting a velocity or force onto a direction is the everyday version of "how much of this points along that". Enter the vector as a and the direction as b, run the projection, and you get both the projected vector and the signed scalar length along b. That scalar is exactly the component you feed into a work-done or along-track distance calculation.
Verify a linear-algebra exercise step by step
Working through a textbook chapter on dot products, norms and angles, you want a quick oracle to check each result before moving on. Punch in the same vectors the book uses, compare the magnitude, dot product and angle, and you catch an arithmetic slip in seconds instead of trusting an answer key that might have a typo. Share the URL with a study partner and the exact problem reopens.
Sanity-check a 2D heading or movement vector in code
Debugging a 2D game where a sprite drifts off course, you suspect the movement vector is not normalised. Drop the raw vector in, read its magnitude, and if it is not 1 you have found the bug. Normalise it in the tool, copy the unit vector, and compare against what your code produces to pin down where the length crept in.
Common pitfalls
Confusing the dot product with the cross product. The dot product returns a number and tests for perpendicularity; the cross product returns a vector perpendicular to both. Asking for a cross product when you wanted a scalar similarity, or vice versa, gives a result of the wrong type every time.
Trying to take a cross product of mismatched or higher-dimension vectors. The cross product is a 2D or 3D operation only, and both vectors must share the same dimension. Feeding a 2D vector against a 3D one is reported as an error rather than silently padded with a zero, which would hide a real input mistake.
Expecting an angle or unit vector from a zero vector. A vector of length 0 has no direction, so its unit vector and any angle involving it are undefined. The tool says so instead of returning NaN, but it is easy to forget that an all-zeros input is the cause when a result comes back blank.
Privacy
Every operation — the dot and cross products, the magnitude, the angle, the unit vectors and the projection — is plain JavaScript that runs in your browser tab. The vectors you type never leave the page, and nothing is logged. The one caveat: the shareable URL encodes your two vectors and the chosen operation in the query string, so a "share link" pasted into chat will record those numbers in the recipient server's access log. For anything you would rather keep private, use the copy button and paste the result text instead of sharing the URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Chinese Acupoint Locator 200+ meridian acupoints / WHO 2008 standard locations / with contraindications, manipulation, and combinations.
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only
- Anagram Solver Check if two words are anagrams, rearrange a set of letters into every ordering, and read the sorted letter fingerprint, all in your browser
- Angle Converter Degrees, radians, gradians, turns, arcminutes, arcseconds and NATO mils, all from one input, copyable, browser-only