Integer Digit Picker

Extracts the digit at a chosen 1-based position, counted from the left, out of each integer's absolute value in a list, one output line per input line, and reports exactly which line is at fault when a position exceeds an integer's digit count. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

Sometimes you don't need a whole number, just one digit out of it — the hundreds digit of a batch of prices, the third character of a batch of IDs, or a checksum digit sitting at a fixed offset.

This tool takes a list of integers and a target position, and returns just that one digit from each, letting you scan a large list for a specific place value in one pass.

What Is Integer Digit Picker?

A batch digit-extraction tool: for every integer in a list, it reads off the digit sitting at a chosen position (counted from the left, starting at 1) of that integer's absolute value.

It treats each line independently, so a list with wildly different digit counts is handled fine as long as every individual value has a digit at the requested position.

How Integer Digit Picker Works

Each line is parsed as an integer, blank lines are skipped, and any line that isn't a valid whole number stops the tool with a line-specific error.

For each parsed value, the tool takes the absolute value's decimal digit string and reads the character at the requested 1-based index.

If the position is beyond the number of digits available for a given line, the tool reports exactly which line and value ran short instead of guessing or defaulting to blank.

When To Use Integer Digit Picker

Use it to pull a specific place-value digit (units, tens, hundreds, ...) out of a batch of numbers for further processing or validation.

It's handy for spot-checking a checksum or check-digit that's known to sit at a fixed position across a list of IDs or codes.

Features

Advantages

  • Processes an entire list in one pass instead of manually counting characters in each number.
  • Clearly reports which specific line failed rather than failing the whole batch silently.

Limitations

  • Position is fixed for the whole list; it can't pick a different position per line in a single run.
  • Operates on the absolute value, so it can't be used to test whether the sign itself sits at a given "position."

Examples

Picking the second digit from the left

Input

205
-46
17

Output

0
6
7

With position 2: 205 -> "0", -46's absolute value "46" -> "6", and 17 -> "7". The sign on -46 is ignored when counting digit positions.

A position that runs out of digits

Input

205
7

Output

Line 2 ("7") only has 1 digit(s); position 2 is out of range.

205 has enough digits for position 2 ("0"), but the single-digit value 7 does not, so the tool reports the exact offending line instead of producing partial output.

Best Practices & Notes

Best Practices

  • Check the digit count of your shortest value in the list before picking a large position, so you know whether an error is likely.
  • Pair this with Integer Left Padder first if your list has mixed digit widths and you want every value to have a digit at the same position.

Developer Notes

Each line is parsed independently with a regex integer check, then `Math.abs(value).toString()` supplies the digit string that gets indexed at `position - 1`, so the implementation never needs BigInt or manual digit-array math.

Integer Digit Picker Use Cases

  • Extracting a fixed-position check digit from a list of account or product codes
  • Pulling out a specific place-value column from a list of prices or measurements
  • Teaching or demonstrating how place value works across a batch of numbers

Common Mistakes

  • Assuming position counts from the right (it counts from the left, most-significant digit first).
  • Forgetting that the sign doesn't count as a digit, so a negative number's digit positions are identical to its positive counterpart.

Tips

  • Use position 1 to quickly grab the leading digit of every value in a list, useful for a rough magnitude/bucket check.
  • If you're unsure how many digits your values have, run them through Integer Decomposer first to see the full place-value breakdown.

References

Frequently Asked Questions