.CQL file extension
To open .CQL files on Windows, open the .cql file with a text/code editor (for example, use Open with and choose a text editor) to view the content.
To open a .cql file, start by opening it as text (for viewing/editing) in a code editor. If you need to run or validate it, use the appropriate CQL tooling for the dialect (most commonly HL7 Clinical Quality Language) rather than renaming the extension.
Last updated: April 30, 2026 · Reviewed by Julian Stricker
Open on your device
Choose your operating system for a dedicated step-by-step opening guide.
How to open .CQL files
Use these platform-specific instructions to open .CQL files safely.
Windows
- Open the .cql file with a text/code editor (for example, use Open with and choose a text editor) to view the content.
- If the file is HL7 Clinical Quality Language, use CQL-aware tooling from the HL7 CQL ecosystem to validate/translate it (refer to the HL7 CQL specification site for guidance).
- If it contains SRU/SRW Contextual Query Language, use it within the relevant SRU/SRW client or system that expects CQL queries.
Mac
- Open the .cql file in a text/code editor to inspect the CQL content.
- For HL7 Clinical Quality Language workflows, use CQL tooling referenced by the HL7 CQL documentation to validate/translate the file.
- For SRU/SRW Contextual Query Language, use the file/query with the SRU/SRW software or service it was created for.
Linux
- Open the .cql file in a text editor to view and edit it (it is typically plain text).
- If your desktop environment does not recognize it, add an association using your system’s MIME/app settings (Linux desktops commonly rely on the freedesktop.org shared-mime-info mechanism).
- Use the appropriate CQL ecosystem tools (HL7 CQL or SRU/SRW CQL) depending on what the file contains.
iOS
- Open the .cql file in the Files app using a text/code editor app; if no suitable editor is installed, transfer the file to a desktop system to view and validate it with CQL tooling.
Android
- Open the .cql file with a text/code editor app; for validation/translation or use within a system, transfer it to a desktop environment with the appropriate HL7 CQL or SRU/SRW tooling.
Security notes
- .cql is usually plain text, but treat it as untrusted input: CQL processors, validators, or search clients that parse CQL could have vulnerabilities, so prefer well-maintained tools and avoid running unknown tooling on sensitive systems.
- Be cautious with .cql content before executing or deploying it in production (for example, clinical logic or search queries can cause unintended behavior or performance issues when run against real systems).
- If you only need to inspect a .cql file, opening it in a text editor is generally lower risk than importing it into specialized systems or services.
Recommended antivirus software
Scan files before opening them. These antivirus tools help protect against malware and viruses.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Can't open this file?
These are the most common causes and fixes when .CQL files fail to open.
Common reasons
- The .cql file opens as gibberish or unexpected content
- It opens in the wrong application (or no app is associated)
- CQL tooling reports syntax/validation errors
Fix steps
- Verify the file was not renamed incorrectly and re-download or re-export it from the source system if possible.
- Try opening it in a different text editor that can detect encodings (UTF-8 is commonly expected for modern text).
OS-specific troubleshooting
What is a .CQL file?
A .cql file is generally a text document containing CQL source. Depending on context, “CQL” most often refers to HL7 Clinical Quality Language (used to express clinical logic) or Contextual Query Language (used with SRU/SRW for search queries). The HL7 CQL specification identifies the media type text/cql for CQL text documents, though registration status should be verified against IANA when strict compliance is required.
Background
In healthcare settings, .cql commonly contains HL7 Clinical Quality Language (CQL) libraries: human-readable, declarative expressions used to define clinical logic and quality measurement criteria. The HL7 CQL specification describes how a CQL library corresponds to a CQL file and documents a media type of text/cql for CQL text documents.
In library and information-retrieval systems, .cql may instead contain Contextual Query Language queries, as defined in the SRU/SRW ecosystem. These queries are used to express searches in a standardized way.
Because “CQL” is ambiguous (multiple standards share the acronym), the best way to identify what your .cql file contains is to open it in a text editor and look for clues such as HL7 library headers/clinical terms versus SRU/SRW query syntax. In both common uses, the file is plain text, so viewing it safely is typically straightforward.
Common MIME types: text/cql
Further reading
Authoritative resources for more details on the .CQL format.
- HL7 Clinical Quality Language (CQL) Specification site
- HL7 Clinical Quality Language Specification R1.2 (PDF)
- Contextual Query Language (CQL) Specifications (Library of Congress, SRU)
- IANA Media Types registry (to verify MIME-type registration/status)
- Shared MIME-info Database Specification (freedesktop.org)
Common .CQL issues
The .cql file opens as gibberish or unexpected content
Most .cql files are plain text; if it looks like binary data or unreadable characters, the file may be misnamed, corrupted, or not actually CQL source.
- Verify the file was not renamed incorrectly and re-download or re-export it from the source system if possible.
- Try opening it in a different text editor that can detect encodings (UTF-8 is commonly expected for modern text).
It opens in the wrong application (or no app is associated)
File associations can be missing or incorrect, especially because .cql is used across different domains and isn’t always recognized automatically.
- Set your preferred text/code editor as the default app for .cql so you can reliably view/edit it.
- On Linux, ensure your desktop MIME associations are configured (many environments use the freedesktop.org shared-mime-info approach).
CQL tooling reports syntax/validation errors
Clinical Quality Language (HL7) and Contextual Query Language (SRU/SRW) have different syntaxes; using the wrong parser or version will produce errors.
- Open the file as text and confirm which CQL dialect it contains (HL7 Clinical Quality Language vs SRU/SRW Contextual Query Language).
- Check that your tools match the expected CQL specification/version used by the source of the file.
FAQ
Is a .cql file just a text file?
In the common cases covered by the CQL standards (HL7 Clinical Quality Language and SRU/SRW Contextual Query Language), yes—.cql is typically plain text containing CQL statements.
Why does my .cql file fail to parse?
“CQL” is ambiguous. The file may be HL7 Clinical Quality Language (healthcare logic) or Contextual Query Language (SRU/SRW search queries). Using a tool for the wrong dialect or version commonly causes parsing/validation errors.
Is text/cql an official MIME type?
The HL7 Clinical Quality Language specification lists text/cql for CQL text documents, but for strict MIME-type compliance you should confirm registration/usage expectations against the IANA media types registry.
Can I convert a .cql file by renaming the extension?
No. Renaming does not change the file’s content. If you need another representation, use the appropriate export/translation approach in the CQL toolchain you are using.
Similar file extensions
Compare related formats in the same category to find the right tool faster.