In the online clustering problems, the classification of points into sets (called clusters) is done in an online fashion. Points arrive one by one at arbitrary locations, to be assigned to clusters at the time of arrival without any information about the further points. A point can be assigned to an existing cluster, or a new cluster can be opened for it. Existing clusters cannot be merged or split. We study one-dimensional variants. The cost of a cluster is the sum of a fixed setup cost scaled to 1 and the square of the diameter of the cluster. The goal is to minimize the sum of costs of the clusters used by the algorithm. In this paper we investigate the problem on the line. We examine two versions, both maintaining the properties that a point which was assigned to a given cluster must remain assigned to this cluster, and clusters cannot be merged. In the strict variant, the size and the exact location of the cluster must be fixed when it is initialized. In the flexible variant, the algorithm can shift the cluster or expand it, as long as it contains all points assigned to it. We consider the online and the semi-online (the input is sorted according to their coordinates from smallest to largest i.e., from left to right) versions of the above two variants. We present the first online algorithms for the solution of the problem. We describe algorithms for the strict and the flexible variant both for the online and semi-online versions. We also give lower bounds on the possible competitive ratio in all of the cases.