---
title: "Compare Text"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/nodetool/text/comparetext
markdown: https://docs.nodetool.ai/nodes/nodetool/text/comparetext.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/nodetool/text/comparetext.md
---

# Compare Text

**Type:** `nodetool.text.Compare`

**Namespace:** `nodetool.text`

## Description

Compares two text values and reports ordering.
    text, compare, equality, sort, equals, =

    Use cases:
    - Checking if two strings are identical before branching
    - Determining lexical order for sorting or deduplication
    - Normalizing casing/spacing before compares

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| text_a | `str` |  | `` |
| text_b | `str` |  | `` |
| case_sensitive | `bool` | Compare without lowercasing | `true` |
| trim_whitespace | `bool` | Strip leading/trailing whitespace before comparing | `false` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| output | `str` |  |

## Related Nodes

Browse other nodes in the [nodetool.text](./) namespace.
