Frequently Asked Questions
The Basics
Colab is a hosted Jupyter Notebook service that requires no setup to use and provides free of charge access to computing resources, including GPUs and TPUs. Colab is especially well suited to machine learning, data science, and education.
Yes. Colab is free of charge to use.
In order to provide access to as many students and under-resourced groups around the world as possible, Colab prioritizes users who are actively programming in a notebook. Colab also restricts actions that negatively impact others or are associated with bypassing our anti-abuse policies. See Which activities are restricted in Colab? for a list of actions that are disallowed. Colab resources are not guaranteed and not unlimited, and usage limits sometimes fluctuate. This is necessary for Colab to be able to provide resources free of charge. For more details, see Resource Limits.
Colab managed runtimes prohibit abusive actions that negatively impact others and actions associated with bypassing our policies. The following are disallowed from all managed Colab runtimes:
- file hosting, media serving, or other web service offerings not related to interactive compute with Colab
- downloading torrents or engaging in peer-to-peer file-sharing
- connecting to remote proxies
- mining cryptocurrency
- running denial-of-service attacks
- password cracking
- using multiple accounts to work around access or resource usage restrictions
- creating deepfakes
Unfortunately it is not possible to provide more specificity in how our abuse detection system works as bad actors try to take advantage of the compute subsidies Colab offers.
In addition to these restrictions, and in order to provide access to students and under-resourced groups around the world, Colab prioritizes users who are actively programming in a notebook. The following are disallowed from managed Colab runtimes running free of charge, without a positive Colab compute unit balance, and may be terminated at any time without warning:
- remote control such as SSH shells, remote desktops
- bypassing the notebook UI to interact primarily via a web UI
- chess training
- running distributed computing workers
You can remove these types of restrictions by purchasing one of our paid plans here and maintaining a positive compute unit balance. You may find not all runtimes that match the descriptions are terminated; we attempt to support as much as we can within reason to benefit the global community.
You can purchase guaranteed resources without Colab-enforced usage limitations via GCP Marketplace or Colab Enterprise or use your own compute via a local runtime you control. Note that Google Drive mounting on the runtime filesystem will not work with these approaches.
In order to provide access to students and under-resourced groups around the world, Colab prioritizes users who are actively programming in a notebook.
Users in our free of charge tier commonly experience runtime terminations when attempting to bypass the notebook UI and using a web UI on a Colab managed runtime for content generation. These experiences are popular and impressive, but are compute intensive and fall outside our priorities for our free of charge tier users, who we want to help in programming.
You can remove these types of restrictions by purchasing one of our paid plans here.
You can purchase guaranteed resources without Colab-enforced usage limitations via GCP Marketplace or Colab Enterprise or use your own compute via a local runtime you control. Note that Google Drive mounting on the runtime filesystem will not work with these approaches.
Jupyter is the open source project on which Colab is based. Colab allows you to use and share Jupyter notebooks with others without having to download, install, or run anything.
Using Colab
Colab notebooks are stored in Google Drive, or can be loaded from GitHub. Colab notebooks can be shared just as you would with Google Docs or Sheets. Simply click the Share button at the top right of any Colab notebook, or follow these Google Drive file sharing instructions.
If you choose to share a notebook, the full contents of your notebook (text, code, output, and comments) will be shared. You can omit code cell output from being saved or shared by using Edit > Notebook settings > Omit code cell output when saving this notebook. The virtual machine you’re using, including any custom files and libraries that you’ve setup, will not be shared. So it’s a good idea to include cells which install and load any custom libraries or files that your notebook needs.
Yes. Choose "Upload notebook" from the File menu.
You can search Colab notebooks using Google Drive. Clicking on the Colab logo at the top left of the notebook view will show all notebooks in Drive. You can also search for notebooks that you have opened recently using File > Open notebook.
Code is executed in a virtual machine private to your account. Virtual machines are deleted when idle for a while, and have a maximum lifetime enforced by the Colab service.
You can download any Colab notebook that you’ve created from Google Drive following these instructions, or from within Colab’s File menu. All Colab notebooks are stored in the open source Jupyter notebook format ( .ipynb).
Selecting Runtime > Disconnect and delete runtime to return all managed virtual machines assigned to you to their original state. This can be helpful in cases where a virtual machine has become unhealthy e.g. due to accidental overwrite of system files, or installation of incompatible software. Colab limits how often this can be done to prevent undue resource consumption. If an attempt fails, please try again later.
drive.mount()
saying "timed out", and why do I/O operations reading from folders sometimes fail?linkdoneGoogle Drive operations can time out when the number of files or subfolders in a folder grows too large. Avoid storing thousands of items in the top-level "My Drive" folder: storing more than approximately ten thousand items in the root directory can cause mounting to fail.
If you encounter this problem, try moving files and folders directly contained in "My Drive" into sub-folders, though each folder should not contain more than ten thousand items.
A similar problem can occur when reading from other folders after a successful drive.mount()
. Accessing items in any folder containing many items can cause errors like OSError: [Errno 5] Input/output error
. You can fix this problem by moving directly contained items into sub-folders.
Note that "deleting" files or subfolders by moving them to the Trash may not be enough; if that doesn't seem to help, make sure to also Empty your Trash.
You can also try using DagsHub Storage, an alternative to Google Drive that is built for working on large datasets and machine learning and tends to be more scalable and reliable for the type of workflows common on Colab. Read more in their docs, or check out the example notebook. DagsHub is a third-party service not affiliated with Google.
drive.mount()
sometimes slow?linkdoneFiles stored in Google Drive may be stored in a distant region from your Colab runtime. To maximize performance, reduce read/writes from Drive. Note that operations in folders mounted by drive.mount()
, rely on the Colab runtime. If you attempt to move files from one folder to another via Colab and your operation is interrupted, you may lose all of the data in transit.
Mounting Google Drive on Colab allows any code in your notebook to access any files in your Google Drive. We usually require that users manually grant this access every time they connect to a new runtime by adding a code cell to the notebook. This ensures that the user fully understands the permissions being granted to the notebook.
In some cases, we only require Google Drive authorization once, and automatically re-mount Google Drive during future sessions. To protect your files, we only allow this when a notebook passes multiple checks. For example, any notebooks which have been edited by another user do not automatically mount Google Drive.
Google Drive enforces various limits, including per-user and per-file operation count and bandwidth quotas. Exceeding these limits will trigger Input/output error
as above, and show a notification in the Colab UI. A typical cause is accessing a popular shared file, or accessing too many distinct files too quickly. Workarounds include:
- Copy the file using drive.google.com and don't share it widely so that other users don't use up its limits.
- Avoid making many small I/O reads, instead opting to copy data from Drive to the Colab VM in an archive format (e.g.
.zip
or.tar.gz
files) and unarchive the data locally on the VM instead of in the mounted Drive directory. - Wait a day for quota limits to reset.
Google Drive imposes a limit on how much data can be stored in it by each user. If Drive operations are failing withInput/output error
and a notification says storage quota has been exceeded, delete some files using drive.google.com and Empty your Trash to reclaim the space. It might take a little while for the reclaimed space to be available in Colab.
If you'd like to purchase more Drive space, visit Google Drive. Note that purchasing more space on Drive will not increase the amount of disk available on Colab VMs. Subscribing to Colab Pro will.
Resource Limits linkdone
In order to dynamically offer powerful GPUs at scale for a low price, Colab needs to maintain the flexibility to adjust usage limits and hardware availability dynamically.
In the version of Colab that is free of charge, access to expensive resources like GPUs is heavily restricted. For the paid version of Colab, we target giving our users high value per their spend.
You can purchase guaranteed resources without Colab-enforced usage limitations via GCP Marketplace or Colab Enterprise or use your own compute via a local runtime you control. Note that Google Drive mounting on the runtime filesystem will not work with these approaches.
Colab is able to provide resources free of charge in part by having dynamic usage limits that sometimes fluctuate, and by not providing guaranteed or unlimited resources. This means that overall usage limits as well as idle timeout periods, maximum VM lifetime, GPU types available, and other factors vary over time. Colab does not publish these limits, in part because they can vary over time.
You can access more compute power and longer runtimes by purchasing one of our paid plans here. These plans have similar dynamics in that resource availability may change over time. Paid users whose compute unit balance is exhausted will revert to the free-of-charge tier policies and restrictions until the balance is increased.
You can purchase guaranteed resources without Colab-enforced usage limitations via GCP Marketplace or Colab Enterprise or use your own compute via a local runtime you control. Note that Google Drive mounting on the runtime filesystem will not work with these approaches.
The types of GPUs and TPUs that are available in Colab vary over time. This is necessary for Colab to be able to provide access to these resources free of charge.
You can access premium GPUs subject to availability by purchasing one of our paid plans here.
If you would like access to specific dedicated hardware, explore using GCP Marketplace Colab.
Colab prioritizes interactive compute. Runtimes will time out if you are idle.
In the version of Colab that is free of charge notebooks can run for at most 12 hours, depending on availability and your usage patterns. Colab Pro, Pro+, and Pay As You Go offer you increased compute availability based on your compute unit balance.
In general, notebooks can run for at most 12 hours, depending on availability and your usage patterns. You can expect to experience backend termination if you exhaust your available compute units on a Pro, Pro+, or Pay As You Go plan.
Colab Pro+ supports continuous code execution for up to 24 hours if you have sufficient compute units. Idle timeouts only apply if code execution terminates.
You can fully relax any runtime limits and idle timeouts by purchasing a dedicated VM at GCP Marketplace.
In the version of Colab that is free of charge you are able to access VMs with a standard system memory profile.
In paid versions of Colab you are able to access machines with a high memory system profile subject to availability and your compute unit balance.
Note that memory refers to system memory. All GPU chips have the same memory profile.
Consider closing your Colab tabs when you are done with your work, and avoid opting for GPUs or extra memory when it is not needed for your work. This will make it less likely that you will run into usage limits within Colab. You can always purchase more compute via Pay As You Go should you hit limits.
For more information on getting the most out of the paid version of Colab, see Making the Most of your Colab Subscription.
Colab offers optional accelerated compute environments, including GPU and TPU. Executing code in a GPU or TPU runtime does not automatically mean that the GPU or TPU is being utilized. To avoid hitting your GPU usage limits, we recommend switching to a standard runtime if you are not utilizing the GPU. Choose Runtime > Change Runtime Type and set Hardware Accelerator to None.
For examples of how to utilize GPU and TPU runtimes in Colab, see the Tensorflow With GPU and TPUs In Colab example notebooks.
The New AI-First Colab
The new AI-First Colab is a reimagining of the Colab experience, transforming it into an intelligent coding partner. It features a suite of deeply integrated AI capabilities designed to understand your goals and accelerate your entire workflow. This is all accessed through a unified conversational experience, available right in your notebook. Key features include:
- Iterative Querying: A simple conversational interface for generating code, explaining concepts, and fixing errors.
- Next-Generation Data Science Agent (DSA): An agent that can autonomously analyze data, generate a plan, execute code, and present findings.
- Effortless Code Transformation: The ability to modify existing code across your notebook using natural language descriptions.
The AI features are enabled by default for all eligible users and are integrated throughout the Colab interface. The easiest way to get started is to click the Gemini spark icon in the notebook footer to open the main chat panel. You will also see AI-enabled autocompletions as you type.
Access to Colab's AI features requires your Google account's age to be 18+. If you meet the age requirement and still do not see the features (like the Gemini spark icon or AI-autocompletions), please ensure you are in a supported locale.
If you have confirmed your eligibility and still lack access, please report this using the in-product feedback tool (Help > Send feedback). If you'd like a response via email, you must select the box titled 'We may email you for more information or updates'.
Colab's AI is designed to be a versatile partner. You can ask it to:
- Generate and transform Code: Ask for short functions, boilerplate, or even refactor code across multiple cells.
- Chat about python libraries: Discover new tools and ask for sample usage grounded in the context of your work.
- Fix errors intelligently: When errors arise, Colab will iteratively suggest fixes in a diff view for your review.
- Execute autonomous agentic flows: Trigger complete analytical workflows with the Data Science Agent. Simply provide a high-level goal, and the agent will generate a plan, execute the necessary code, and present its findings.
- Analyze your data: Upload files (like CSVs, JSON, or Excel) or point to data in your runtime and ask the AI to perform in-depth analysis, create visualizations, and uncover insights.
Yes. A key feature of the AI-First Colab is its ability to create and execute plans to accomplish a goal. When you ask for a multi-step task, such as analyzing a dataset, the agent will present a plan for your review. You can then choose to execute it, maintaining control while the agent works. During execution, it can reason about results, self-correct errors, and adjust its plan.
Colab AI itself does not directly browse the internet. However, it can generate and execute code that accesses the internet (e.g., using requests to call an API or wget to download a file into your runtime).
By default, Colab AI does not have access to your Google Drive files or user secrets. However, it can generate code that accesses them at your explicit request.
Colab AI supports a variety of common file types, including CSV, TSV, JSON, and Excel files (XLS, XLSX, XLSM, XLSB). You can upload files directly in the chat interface for analysis.
Your feedback is crucial for improving the experience. For any AI-generated response, you will see thumbs-up and thumbs-down icons. Please use them to rate the quality of the output. For more detailed feedback, use the overflow menu on the right (...) > Send feedback option from the menu.
Colab's AI is a powerful collaborator designed to accelerate your workflow and help you prototype ideas faster than ever. As with any coding assistant, you are responsible for your use of the code. We strongly recommend that you carefully test, review, and validate all generated code to ensure it is accurate, secure, and meets your project's requirements before relying on it. To assist with this, Colab will also cite any generated code that directly quotes from a source with an open-source license.
When you use generative AI features in Colab, Google collects prompts, related code, generated output, related feature usage information, and your feedback. Google uses this data to provide, improve, and develop Google products and services and machine learning technologies, including Google's enterprise products such as Google Cloud.
To help with quality and improve our products, human reviewers may read, annotate, and process your prompts, generated output, related feature usage information, and your feedback. Please do not include sensitive (e.g., confidential) or personal information that can be used to identify you or others in your prompts or feedback. Your data will be stored in a way where Google cannot tell who provided it and can no longer fulfill any deletion requests and will be retained for up to 18 months.
Additional Questions
Colab works with most major browsers, and is most thoroughly tested with the latest versions of Chrome, Firefox and Safari.
In 2014 we worked with the Jupyter development team to release an early version of the tool. Since then Colab has continued to evolve, guided by internal usage.
Colab focuses on supporting Python and its ecosystem of third-party tools. We're aware that users are interested in support for other Jupyter kernels (eg R or Scala). We would like to support these, but don't yet have any ETA.
Open any Colab notebook. Then go to the Help menu and select ”Send feedback...”.
Colab uses HTML iframes and service workers hosted on separate origins in order to display rich outputs securely. Browsers require enabling third-party cookies to use the service workers within iframes. An alternative to enabling third-party cookies for all sites is to allow the following hostname in your browser settings: googleusercontent.com.
Colab uses a generic monospace font for the editor. You can configure what font family is used for monospace in most modern browsers. Here's a few common ones:
- In Firefox, follow the steps provided in the Firefox support documents to configure the "Monospace" font.
- In Chrome, navigate to "chrome://settings/fonts" and modify the section labeled "Fixed-width font".
Python 2 is no longer supported in Colab. For information on migrating your code from Python 2 to Python 3, see Porting Python 2 Code to Python 3.
There is an FAQ on the sign-up page.
Information for Colab Pro, Pro+, and Pay As You Go, including pricing and how upgrades are handled, can be found at the sign-up page.
Access to Colab for Workspace users is controlled by the Workspace on/off control accessible to your organization's administrator.
Workspace for Education organizations are required to obtain parental consent for students' (under the age of 18) use of Additional Services with their Google Workspace for Education account. This can be achieved with this notice template. Please be sure to include Colab in the list of additional services.
For more information, please read our Help Center article “Communicating with Parents and Guardians about Google Workspace for Education”.