YAML Number Extractor

Paste YAML and get back only its numeric values, strings, booleans, and nulls filtered out entirely, one number per line, useful for auditing ports, replica counts, timeouts, and other numeric settings scattered across a config. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-22

Overview

Introduction

Numeric settings, ports, timeouts, replica counts, thresholds, tend to be scattered across a config wherever they were needed, not grouped together. This tool pulls every numeric value out into one flat list, making it easy to sanity-check ranges or spot an obviously wrong value.

It's the numeric counterpart to Extract Values from YAML, useful whenever you specifically care about the numbers and want everything else filtered out.

What Is YAML Number Extractor?

A YAML number extractor walks a parsed document and collects every leaf value whose resolved type is `number`, skipping strings, booleans, and nulls entirely.

The result is a flat, newline-separated list of just the numeric values in the document, in the order they appear.

How YAML Number Extractor Works

The input is parsed with a full YAML 1.2 parser, which resolves each plain scalar to its actual type (so `3` becomes a number while `"3"` stays a string). The resulting value is walked recursively, and only leaves that are finite JavaScript numbers after parsing are added to the output.

Because filtering happens on the resolved type, quoting a numeric-looking value in the source YAML is exactly what determines whether it's included here or in Extract Strings from YAML instead.

When To Use YAML Number Extractor

Use it to sanity-check numeric settings across a large config, spotting an outlier replica count or an unusually long timeout.

It's also useful for a quick sense of how many numeric knobs a config exposes before deciding whether it needs a schema or validation layer.

Features

Advantages

  • Filters by resolved type, so quoted numeric-looking strings are correctly excluded.
  • Cuts through string and boolean noise to surface just the numeric settings.
  • Handles arbitrarily nested mappings and sequences of any depth.
  • Runs entirely client-side, so configuration values never leave your browser.

Limitations

  • The output has no key or path information; pair with Extract Keys from YAML if you need to know which setting each number belongs to.
  • Numbers are reformatted through JavaScript's default number-to-string conversion, so unusual source formatting (leading zeros, trailing zeros after a decimal point) isn't preserved exactly.
  • A quoted numeric string in the source (like a version number `"1.0"`) is intentionally excluded here, since it was authored as text, not a number.

Examples

Filtering numbers out of a mixed-type mapping

Input

name: api
replicas: 3
port: 8080
active: true

Output

3
8080

Only the two numeric values are kept; the string and boolean are excluded entirely.

Best Practices & Notes

Best Practices

  • Use this to spot-check numeric ranges (ports in valid ranges, replica counts that make sense) across a large config quickly.
  • Cross-check against Extract Yaml Values if a number you expected didn't appear, it may have been quoted and resolved to a string instead.
  • Combine with YAML Statistics for a broader sense of a document's overall composition before drilling into just the numbers.

Developer Notes

This is a straightforward type-filtered variant of the site's general value extractor: the same recursive walk, but the collection step only pushes a value onto the output when `typeof value === "number" && Number.isFinite(value)`. Type resolution itself is entirely delegated to the `yaml` package's parser, this tool does no additional type-guessing of its own.

YAML Number Extractor Use Cases

  • Auditing numeric settings (ports, timeouts, replica counts) scattered across a large config
  • Spotting an outlier or obviously wrong numeric value during a config review
  • Getting a quick numeric-only summary of a config's settings
  • Feeding extracted numbers into a validation script or spreadsheet for range-checking

Common Mistakes

  • Expecting quoted version-like strings (`"1.0"`) to appear here, they're excluded since they resolved to the string type, not a number.
  • Assuming the output preserves exact source formatting like leading zeros, it doesn't; numbers are reformatted through standard JS number-to-string conversion.
  • Forgetting that this tool strips all context; cross-reference with Extract Keys from YAML if you need to know which setting each number belongs to.

Tips

  • If a number you expected is missing, check Extract Yaml Values to see whether it actually resolved to a string instead.
  • Use alongside Extract Strings from YAML when auditing a config's two most common value types separately.
  • Pair with Sort YAML first if you want the extracted numbers to reflect a specific key order rather than the original document order.

References

Frequently Asked Questions