# Uniq Array

Remove duplicates from an array using lodash _.uniq

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

- **Category:** Data Processing

- **Keywords:** array, unique, dedupe, filter, lodash

## Overview

Remove duplicate values from a JSON array.

**Highlights:**
- Uses lodash `_.uniq`
- Keeps the first occurrence of each value
- Returns unique values as JSON

**Example:**
- Array: `[1, 2, 2, 3]`
- Result: `[1, 2, 3]`

## Inputs

- **Array** (textarea): Enter a JSON array

## When to use

- When you need to sanitize a list of IDs or tags by removing redundant entries.
- When preparing data for API requests that require unique identifiers.
- When you want to quickly verify the unique items present in a large JSON dataset.

## How it works

- Paste your JSON array into the input field.
- The tool processes the array using the lodash _.uniq function.
- The system automatically filters out all subsequent duplicate values.
- The resulting unique JSON array is displayed for immediate use.

## Use cases

- Cleaning up user-provided input lists to prevent duplicate database entries.
- Normalizing configuration arrays where only unique settings are permitted.
- Preparing clean datasets for frontend dropdown menus or selection lists.

## Frequently asked questions

### What happens to the duplicate values?

Duplicate values are removed, and only the first occurrence of each unique item is kept in the final output.

### Does this tool support nested objects?

This tool is designed for standard JSON arrays of primitives. For complex nested objects, ensure your input is a valid flat array.

### Is the order of elements preserved?

Yes, the tool maintains the original order of the first occurrences while stripping away any subsequent duplicates.

### What library does this tool use?

This tool utilizes the industry-standard lodash _.uniq method to ensure accurate and efficient deduplication.

### Is my data stored on your servers?

No, all processing is performed locally in your browser to ensure your data remains private and secure.

## Related tools

- [Compact Array](https://elysiatools.com/en/tools/compact-array): Remove falsey values from array using lodash _.compact
- [Drop Items](https://elysiatools.com/en/tools/drop-items): Drop first N items from array using lodash _.drop
- [Drop Right Items](https://elysiatools.com/en/tools/drop-right-items): Drop last N items from array using lodash _.dropRight
- [Pull Values](https://elysiatools.com/en/tools/pull-values): Remove specific values from an array using lodash _.pull
- [Sorted Unique](https://elysiatools.com/en/tools/sorted-unique): Remove duplicates from a sorted array using lodash _.sortedUniq
- [Sorted Unique By](https://elysiatools.com/en/tools/sorted-unique-by): Remove duplicates from a sorted array using lodash _.sortedUniqBy
- [Uniq By](https://elysiatools.com/en/tools/uniq-by): Remove duplicates from an array using lodash _.uniqBy with a property path
- [Without Values](https://elysiatools.com/en/tools/without-values): Remove specified values from an array using lodash _.without

## Samples

- [Grafana Advanced Application Samples](https://elysiatools.com/en/samples/grafana-samples): Comprehensive Grafana samples covering advanced dashboard design, alerting configurations, data source integrations, and plugin development
- [QR Code Samples](https://elysiatools.com/en/samples/qrcode-samples): Sample QR code images for testing QR code reading and generation tools
- [D3.js Data Visualization Samples](https://elysiatools.com/en/samples/d3js-data-visualization): Comprehensive D3.js data visualization examples including charts, maps, animations, and interactive visualizations
- [Rome JavaScript Toolchain Samples](https://elysiatools.com/en/samples/rome): Rome JavaScript toolchain examples including configuration, linting, formatting, bundling, and project management
