Prime Factorisation Calculator

This prime factorisation calculator breaks a whole number down into the prime numbers that multiply together to make it. Enter a number from 2 up to a billion and the calculator returns its prime factorisation in index form, such as 360 = 2 cubed times 3 squared times 5, along with the total number of prime factors counted with repetition and the number of distinct primes. Every integer greater than one has exactly one prime factorisation, a result known as the fundamental theorem of arithmetic, which is why this is a building block for finding factors, simplifying fractions, and working out the greatest common factor and lowest common multiple. The method, a worked example and the assumptions are set out below.

Conservation Amendment Bill
 
Prime factors (with multiplicity) 
Distinct primes 

The formula

By the fundamental theorem of arithmetic, every integer n greater than 1 is a unique product of primes, n = p1^a1 times p2^a2 and so on. The calculator divides out the smallest prime repeatedly, then the next, until what remains is 1.

Worked example

360 divides by 2 three times to give 45, then by 3 twice to give 5, which is prime. So 360 = 2^3 \u00D7 3^2 \u00D7 5, six prime factors in total across three distinct primes. Enter 360 to confirm.

Frequently asked questions

What is a prime factorisation?

The unique set of prime numbers, with their powers, that multiply to give the number, for example 12 = 2 squared times 3.

Is the factorisation always unique?

Yes. The fundamental theorem of arithmetic says every integer above 1 has exactly one prime factorisation, apart from the order of the factors.

Why is the upper limit a billion?

The calculator uses trial division, which stays fast up to a billion. Much larger numbers need specialised algorithms.

Who this calculator is for

This calculator is for students, programmers and anyone exploring number theory.

What this calculator assumes

  • You enter a whole number within the stated range.
  • The exact integer algorithm is used.
  • Very large results are shown grouped for readability.

Formula and sources

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-06-21 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.