# Array Extractor

Extract elements of specific types from arrays (numbers, strings, booleans, objects, etc.)

> Canonical page: https://elysiatools.com/en/tools/array-extractor

- **Category:** Data Processing

- **Keywords:** array, extract, filter, type, numbers, strings, booleans, objects, separate, classify

## Overview

The Array Extractor is a versatile utility designed to quickly isolate specific data types from mixed-content arrays. Whether you are cleaning messy datasets or filtering raw inputs, this tool allows you to extract integers, floats, strings, or booleans with precision and ease.

## Inputs

- **Input Array** (textarea): Enter array as JSON format: \[3, 1, 2\] or comma-separated values: 3, 1, 2 or one per line
- **Extract Type** (select)
- **Include Null Values (包含Null值)** (checkbox)
- **Include Undefined Values (包含Undefined值)** (checkbox)
- **Case Sensitive (for strings)** (checkbox)
- **Trim Whitespace (for strings)** (checkbox)
- **Custom Separator (for text input)** (text): Enter separator (default: comma, semicolon, or newline)

## When to use

- When you need to separate numerical values from a mixed list of strings and numbers.
- When cleaning raw data inputs that contain unwanted null or undefined values.
- When you need to standardize a list of strings by trimming whitespace and filtering by type.

## How it works

- Paste your data into the input field as a JSON array, comma-separated values, or one item per line.
- Select the specific data type you wish to extract from the dropdown menu.
- Toggle optional settings like 'Include Null Values' or 'Trim Whitespace' to refine the output.
- Click the process button to generate a clean, filtered list of your desired elements.

## Use cases

- Extracting only numerical IDs from a mixed log file containing text and numbers.
- Cleaning a user-submitted form list by removing all null and undefined entries.
- Isolating boolean flags from a complex configuration object array.

## Frequently asked questions

### What input formats are supported?

The tool accepts standard JSON arrays, comma-separated values, or lists where each item is on a new line.

### Can I extract multiple types at once?

No, the tool is designed to extract one specific data type per operation to ensure accuracy.

### How does the tool handle whitespace in strings?

You can enable the 'Trim Whitespace' option to automatically remove leading and trailing spaces from extracted strings.

### Does it support custom separators?

Yes, you can define a custom separator if your input data uses a specific character other than commas or newlines.

### Are my inputs saved on your server?

No, all processing is performed locally in your browser, ensuring your data remains private.

## Related tools

- [JSON Key Extractor](https://elysiatools.com/en/tools/json-key-extractor): Extract all keys from JSON objects with multiple output formats. Perfect for analyzing JSON structure, documentation generation, and understanding complex nested objects.
- [Array Deduplicator](https://elysiatools.com/en/tools/array-deduplicator): Remove duplicate elements from arrays with various deduplication methods
- [Array Filter](https://elysiatools.com/en/tools/array-filter): Filter out elements of specific types from arrays (remove numbers, strings, booleans, etc.)
- [Chinese Character Extractor (汉字提取器)](https://elysiatools.com/en/tools/chinese-character-extractor): Extract all Chinese characters from text, filtering out punctuation and English letters, numbers, and non-Chinese symbols
- [ECharts Theme Token Extractor](https://elysiatools.com/en/tools/echarts-theme-token-extractor): Extract design tokens — colors, numbers, font sizes and strings — from an ECharts theme JSON and export them straight into your design system. Paste a theme object (the kind registered via echarts.init(dom, themeName)) and the tool walks every leaf, tagging each color (with optional named/rgb → hex normalization), spacing number, font size and string, then emits clean CSS variables, a Tailwind theme.extend config, Style Dictionary tokens.json, or SCSS variables. Bridges the gap between an ECharts visualization theme and Figma/CSS/Tailwind design tokens without copying each value by hand.
- [Emoji Extractor](https://elysiatools.com/en/tools/emoji-extractor): Extract all Unicode emoji from text, or optionally remove emojis
- [PDF Text Extractor](https://elysiatools.com/en/tools/pdf-text-extractor): Extract text content from PDF documents with support for page selection, formatting options, and multi-language processing
- [SRT / ASS Subtitle Text Extractor](https://elysiatools.com/en/tools/srt-ass-subtitle-extract-text): Extract clean dialogue text from pasted SRT, ASS, or SSA subtitles.

## Samples

- [Phone Number Extractor Samples](https://elysiatools.com/en/samples/phone-number-extractor): Collection of mixed text containing phone numbers from various countries for extraction testing
- [Changelog Extractor Samples](https://elysiatools.com/en/samples/changelog-extractor): Various changelog formats for testing changelog parsing and extraction tools
- [Markdown Link Extractor Samples](https://elysiatools.com/en/samples/markdown-with-links): Sample Markdown documents with various link types for testing the Markdown Link Extractor tool
- [Copyright-Free MP3 Audio Samples](https://elysiatools.com/en/samples/mp3-samples): Collection of royalty-free audio samples for testing and development purposes including nature sounds, meditation music, and ambient audio

## Related content

- [Array and List Manipulation Tools](https://elysiatools.com/en/hubs/array-and-list-manipulation-tools): Analyze, deduplicate, sort, shuffle, slice, flatten, group, filter, sample, and transform arrays and lists — plus set operations like union, intersection, and difference — in one hub for data and code prep.
- [Text Case, Encoding, and Normalization Conversion Tools](https://elysiatools.com/en/hubs/text-convert): Compare text case conversion, character-width conversion, encoding conversion, quoted-printable handling, and inline text normalization tools in one hub.
- [Text Tools](https://elysiatools.com/en/hubs/text-utility): Explore 33 text tools for utility workflows and compare closely related utilities quickly.
- [Text Analysis, Readability, and Content Inspection Tools](https://elysiatools.com/en/hubs/text-analyze): Compare text statistics, language detection, readability scoring, sentiment analysis, moderation review, and pattern analysis tools in one hub.
