---
title: "AI Grammar Checking"
---


Checking grammar in documents is important to ensure clarity, professionalism, and accuracy. Well-written documents leave a positive impression and avoid misunderstandings. Grammar checks help identify and correct errors quickly, saving time and improving quality.

Aspose.Words allows users to check grammar and detect errors in documents using the OpenAI, Google, and Anthropic models' families listed in the [AiModelType](https://reference.aspose.com/words/nodejs-net/aspose.words.ai/aimodeltype/) enumeration. Use the [checkGrammar](https://reference.aspose.com/words/nodejs-net/aspose.words.ai/iaimodeltext/checkgrammar/) method, available in the [Aspose.Words.AI](https://reference.aspose.com/words/nodejs-net/aspose.words.ai/) namespace. **checkGrammar** analyzes the text in a document and highlights grammatical problems.

The following code example shows how to use the GPT‑4o mini model in Aspose.Words to check grammar:

{{< gist "aspose-words-gists" "757cf7d3534a39730cf3290d418681ab" "ai-grammar.js" >}}

{{% alert color="primary" %}}

Checking grammar with Aspose.Words improves the quality of your work and makes it easy to integrate proofreading into your projects. For more information, check the [Aspose.Words.AI](https://reference.aspose.com/words/nodejs-net/aspose.words.ai/) API documentation.

{{% /alert %}}

------ 

## FAQ

1. **Q:** Which AI models can I use with `checkGrammar`?  
   **A:** The `AiModelType` enumeration lists the supported families: OpenAI (e.g., `GPT4OMini`), Google (e.g., `GeminiPro`), and Anthropic (e.g., `ClaudeInstant`). Choose the appropriate enum value when calling `checkGrammar`.

2. **Q:** Do I need a separate license for the AI features?  
   **A:** No. AI capabilities are included with a regular Aspose.Words license. Ensure your license file is applied before invoking `checkGrammar`.

3. **Q:** What should I do if my document is very large?  
   **A:** `checkGrammar` works on the whole document, but very large files may exceed service limits. Split the document into smaller sections (e.g., by chapter) and call `checkGrammar` on each part, then combine the results.

4. **Q:** How can I tell whether any grammar issues were found?  
   **A:** The method returns a collection of `GrammarError` objects. If the collection is empty, no issues were detected. You can check `result.length` (or the equivalent in your language) to determine this.