In general, the lifespan of bird is based on size most of the larger birds live longer many of the big macaws and African greys can live 30 to 40 years sometimes even more years in captivity. Most birds in captivity don't live as long as in the wild because they're not exposed to the same fresh air and sunlight and nutrition that they would get in the wild but these birds are very long-lived which makes them actually very popular pets. Some of the smaller birds, however, lived shorter periods. Cockatiels and smaller birds like conure usually around 20 years. The better diet and care they get early on the longer you can expect to have a healthy bird in your home. Some of the small parakeets the budgie gars six to eight years.
So, you should consider these things while getting a parrot. Better diet and a good environment can keep your birds live longer.