Autistic Spectrum Disorder (ASD) is a challenging neurological development disorder, which involves poor social interaction, communication, and repetitive behaviours. If autism is identified early enough it can be treated with better outcomes but present diagnostic tests are dependent on subjective opinion, consume a lot of time, and are vague. This study is aimed at optimizing one-dimensional convolutional neural networks (1D CNN) to improve the precision and speed of early ASD diagnosis. Four ASD datasets representing different age groups — toddlers, children, adolescents, and adults were modelled using one-dimensional convolutional neural networks (1D CNN). These datasets are accessible to the public on the UCI Machine Learning Repository and Kaggle, they consist of behavioural features relevant to ASD diagnosis. Each dataset underwent feature selection, categorical encoding, and missing value handling. Then, baseline 1D CNN with predefined hyperparameters was modelled on each of the datasets. Subsequently, the baseline models were optimized using the Tree-structured Parzen Estimator (TPE). An interactive web-based ASD diagnostic tool was developed, where user inputs are processed through age-specific pre-trained optimized models to determine ASD probability. The optimized 1D CNN models significantly outperformed the baseline models across all age groups and achieved scores of 100% in accuracy, precision, recall, F1-score, MCC, and AUC ROC. This implies that the optimized models can reliably identify people in various age groups who have and do not have ASD. The development of an interactive web-based diagnostic tool extends the practical utility of the models, making them accessible for clinical and at-home use.