Borrowed from Chinese 綺麗, made of 綺, patterned silk, and 麗, beautiful. It first meant gorgeous or splendid, and the senses of clean and tidy grew later in Japanese. 奇麗 is an older alternative spelling, and kana きれい is the most common way to write it today.