# Uniq With

Remove duplicates using lodash _.uniqWith and deep equality

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

- **Category:** Data Processing

- **Keywords:** array, unique, deep, compare, lodash

## Overview

Remove duplicates using a deep equality comparator.

**Highlights:**
- Uses lodash `_.uniqWith`
- Compares items with `_.isEqual`
- Useful for arrays of objects

**Example:**
- Array: `[{"id": 1}, {"id": 1}, {"id": 2}]`
- Result: `[{"id": 1}, {"id": 2}]`

## Inputs

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

## When to use

- When you need to clean up arrays of objects that contain identical data structures.
- When standard unique filters fail because they only compare object references rather than content.
- When you want to ensure data integrity by removing redundant records from a JSON dataset.

## How it works

- Paste your JSON array into the input field.
- The tool utilizes the lodash _.uniqWith function to iterate through your data.
- It applies _.isEqual to perform a deep comparison of every object property.
- The tool returns a cleaned array containing only unique, non-redundant objects.

## Use cases

- Cleaning API response data that contains duplicate user or product records.
- Merging multiple data sources into a single, unique list of configuration objects.
- Preparing clean datasets for frontend state management or data visualization.

## Frequently asked questions

### What makes this different from a standard unique filter?

Standard filters often compare object references. This tool uses deep equality, meaning it compares the actual values inside the objects.

### Does this tool support nested objects?

Yes, because it uses lodash's deep equality check, it can accurately identify duplicates even within nested structures.

### What format should my input be in?

The input must be a valid JSON array of objects or values.

### Is the comparison case-sensitive?

Yes, the deep equality check treats strings with different casing as distinct values.

### Can I use this for large datasets?

It is highly efficient for most standard web-based data tasks, though performance may vary depending on the complexity and size of the objects.

## Related tools

- [Remove By Predicate](https://elysiatools.com/en/tools/remove-by-predicate): Remove items that match a predicate using lodash _.remove
- [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 Array](https://elysiatools.com/en/tools/uniq-array): Remove duplicates from an array using lodash _.uniq

## 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
- [SWC Rust Compiler Samples](https://elysiatools.com/en/samples/swc): Speedy Web Compiler (SWC) examples including configuration, plugins, and integration with modern JavaScript/TypeScript projects
- [QR Code Samples](https://elysiatools.com/en/samples/qrcode-samples): Sample QR code images for testing QR code reading and generation tools
- [Apache Pulsar Samples](https://elysiatools.com/en/samples/pulsar-samples): Apache Pulsar examples including pub/sub, readers, consumers with different subscription types, schema management, and tiered storage for enterprise messaging

## Related content

- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
- [JSON Inspection, Diff, and Transformation Tools](https://elysiatools.com/en/hubs/json-utility): Compare JSON formatting, diffing, path inspection, schema validation, merging, transformation, and export tools in one hub for API and data workflows.
- [JSON Schema, Mock Data, and API Fixture Generators](https://elysiatools.com/en/hubs/json-generate): Curated tools for JSON schema generation, mock payload building, and API fixture preparation in one hub.
- [JSON Formatting, Diff, and Normalization Tools](https://elysiatools.com/en/hubs/json-format): Compare JSON formatting, diffing, log review, config comparison, and data-normalization tools in one hub for readable and reviewable JSON workflows.
