Objective To examine the effects of online Cognitive Behavior Therapy for Insomnia (CBTI) on adolescents' sleep and cognitive functioning. Methods 32 adolescents (13–19 years, M = 15.9, SD = 1.6) with DSM-5 insomnia disorder, were randomly assigned to a treatment group (n = 18) or a waiting list (n = 14). Treatment consisted of six guided self-help online CBTI sessions. Both groups were assessed at baseline and post-treatment. Sleep was measured with actigraphy, sleep logs, and questionnaires. Cognitive functioning was assessed with a battery of standard cognitive tests. Results After CBTI the treatment group showed significant improvements compared to the waiting list group in sleep efficiency from actigraphy and sleep logs. This finding was confirmed by improvements in other sleep variables from sleep logs, and in symptoms of chronic sleep reduction and insomnia. Most participants from the treatment group improved to sub clinical levels of insomnia. Cognitive functioning of the treatment group showed more improvement compared to the waiting list in visuospatial processing, selective attention and phonological working memory, and a trend of improvement in response inhibition and set shifting, letter fluency and sustained attention, but not in declarative memory, visuospatial working memory, category fluency, and general cognitive speed. Changes in sleep appeared to be related to changes in cognitive functioning. Conclusions These results indicate that CBTI can have positive effects on cognitive functions in adolescents, with notable improvements in visuospatial processing and phonological working memory but not in visuospatial working memory.