> For the complete documentation index, see [llms.txt](https://docs.browserflow.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.browserflow.app/reference/browserflow-commands/tabs/close-tab.md).

# Close Tab

Closes an existing tab

#### Query Type

* Active Tab
  * Closes the active tab
* URL
  * Closes the tab matching the URL
* Tab ID
  * Closes the tab by its ID

#### Query

* If Query Type is URL
  * URL of the tab to select
    * Matches the first tab that contains the URL as a substring (e.g. "google.com" matches a tab with "mail.google.com")
* If Query Type is Tab ID
  * ID of the tab to select (see [Get Active Tab ID](/reference/browserflow-commands/tabs/get-active-tab-id.md))
