Back to Free Tools

FREE TOOLS

Next and Previous Prime Finder

Find strictly previous and next primes within a chosen finite radius and download every tested candidate and search-bound status.

Integer decimal text, Search radius decimal text

nearest-primes.json

Browser only

Runs locally in your browser. Your files, pasted content and generated output are not uploaded. Reset clears this tool’s working data.

This tool needs JavaScript. If it does not load, refresh the page and try again.

How to use this tool

  • Enter an unsigned integer from 2 to 1,000,000,000,000 and a search radius from 1 to 1,000.
  • Select Find previous and next primes. The entered number is excluded; candidates are tried by increasing distance, previous before next.
  • Download nearest-primes.json to inspect both directional bounds, statuses and every tested candidate.

Examples

1000 with radius 100 finds previous prime 997 and next prime 1009.

Limitations

  • At most 64 input UTF-16 units, 2,000 candidate calls, 2,000,000 conservative divisor-work units, 1 MiB complete output and 30 seconds.
  • Candidate domain is 2 through 1,000,000,000,000. FOUND, NOT_FOUND_WITHIN_BOUND and DOMAIN_BOUND have different meanings; a bounded search does not promise both primes.
  • Before each candidate, charge floor(sqrt(candidate)). Near 1,000,000,000,000 roughly two charges exhaust the budget; exceeding it refuses the complete operation without a partial report.

Related tools

No items found.

More tools for your workflow

Explore the related desktop tool